"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
const ts = __importStar(require("typescript"));
const experimental_utils_1 = require("@typescript-eslint/experimental-utils");
const tsutils = __importStar(require("tsutils"));
const util = __importStar(require("../util"));
const FUNCTION_CONSTRUCTOR = 'Function';
const GLOBAL_CANDIDATES = new Set(['global', 'window', 'globalThis']);
const EVAL_LIKE_METHODS = new Set([
    'setImmediate',
    'setInterval',
    'setTimeout',
    'execScript',
]);
exports.default = util.createRule({
    name: 'no-implied-eval',
    meta: {
        docs: {
            description: 'Disallow the use of `eval()`-like methods',
            category: 'Best Practices',
            recommended: 'error',
            extendsBaseRule: true,
            requiresTypeChecking: true,
        },
        messages: {
            noImpliedEvalError: 'Implied eval. Consider passing a function.',
            noFunctionConstructor: 'Implied eval. Do not use the Function constructor to create functions.',
        },
        schema: [],
        type: 'suggestion',
    },
    defaultOptions: [],
    create(context) {
        const parserServices = util.getParserServices(context);
        const program = parserServices.program;
        const checker = parserServices.program.getTypeChecker();
        function getCalleeName(node) {
            if (node.type === experimental_utils_1.AST_NODE_TYPES.Identifier) {
                return node.name;
            }
            if (node.type === experimental_utils_1.AST_NODE_TYPES.MemberExpression &&
                node.object.type === experimental_utils_1.AST_NODE_TYPES.Identifier &&
                GLOBAL_CANDIDATES.has(node.object.name)) {
                if (node.property.type === experimental_utils_1.AST_NODE_TYPES.Identifier) {
                    return node.property.name;
                }
                if (node.property.type === experimental_utils_1.AST_NODE_TYPES.Literal &&
                    typeof node.property.value === 'string') {
                    return node.property.value;
                }
            }
            return null;
        }
        function isFunctionType(node) {
            var _a;
            const tsNode = parserServices.esTreeNodeToTSNodeMap.get(node);
            const type = checker.getTypeAtLocation(tsNode);
            const symbol = type.getSymbol();
            if (symbol &&
                tsutils.isSymbolFlagSet(symbol, ts.SymbolFlags.Function | ts.SymbolFlags.Method)) {
                return true;
            }
            if (symbol && symbol.escapedName === FUNCTION_CONSTRUCTOR) {
                const declarations = (_a = symbol.getDeclarations()) !== null && _a !== void 0 ? _a : [];
                for (const declaration of declarations) {
                    const sourceFile = declaration.getSourceFile();
                    if (program.isSourceFileDefaultLibrary(sourceFile)) {
                        return true;
                    }
                }
            }
            const signatures = checker.getSignaturesOfType(type, ts.SignatureKind.Call);
            return signatures.length > 0;
        }
        function isBind(node) {
            return node.type === experimental_utils_1.AST_NODE_TYPES.MemberExpression
                ? isBind(node.property)
                : node.type === experimental_utils_1.AST_NODE_TYPES.Identifier && node.name === 'bind';
        }
        function isFunction(node) {
            switch (node.type) {
                case experimental_utils_1.AST_NODE_TYPES.ArrowFunctionExpression:
                case experimental_utils_1.AST_NODE_TYPES.FunctionDeclaration:
                case experimental_utils_1.AST_NODE_TYPES.FunctionExpression:
                    return true;
                case experimental_utils_1.AST_NODE_TYPES.Literal:
                case experimental_utils_1.AST_NODE_TYPES.TemplateLiteral:
                    return false;
                case experimental_utils_1.AST_NODE_TYPES.CallExpression:
                    return isBind(node.callee) || isFunctionType(node);
                default:
                    return isFunctionType(node);
            }
        }
        function checkImpliedEval(node) {
            var _a;
            const tsNode = parserServices.esTreeNodeToTSNodeMap.get(node.callee);
            const type = checker.getTypeAtLocation(tsNode);
            const calleeName = getCalleeName(node.callee);
            if (calleeName === null) {
                return;
            }
            if (calleeName === FUNCTION_CONSTRUCTOR) {
                const symbol = type.getSymbol();
                if (symbol) {
                    const declarations = (_a = symbol.getDeclarations()) !== null && _a !== void 0 ? _a : [];
                    for (const declaration of declarations) {
                        const sourceFile = declaration.getSourceFile();
                        if (program.isSourceFileDefaultLibrary(sourceFile)) {
                            context.report({ node, messageId: 'noFunctionConstructor' });
                            return;
                        }
                    }
                }
                else {
                    context.report({ node, messageId: 'noFunctionConstructor' });
                    return;
                }
            }
            if (node.arguments.length === 0) {
                return;
            }
            const [handler] = node.arguments;
            if (EVAL_LIKE_METHODS.has(calleeName) && !isFunction(handler)) {
                context.report({ node: handler, messageId: 'noImpliedEvalError' });
            }
        }
        return {
            NewExpression: checkImpliedEval,
            CallExpression: checkImpliedEval,
        };
    },
});
//# sourceMappingURL=no-implied-eval.js.map


package org.jbehave.core.model;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 *

 * Represents a tabular structure to hold example data for parameters named via the headers:
 *

 *

 * |header 1|header 2| .... |header n|
 * |value 11|value 12| .... |value 1n|
 * ...
 * |value m1|value m2| .... |value mn|
 *

 *
Different header and value column separators can be specified to replace the default separator "|":

 *

 * !!header 1!!header 2!! .... !!header n!!
 * !value 11!value 12! .... !value 1n!
 * ...
 * !value m1!value m2| .... !value mn!
 *

 */
public class ExamplesTable {

    private static final String NEWLINE = "\n";
    private static final String HEADER_SEPARATOR = "|";
    private static final String VALUE_SEPARATOR = "|";
    private final List<Map<String, String>> data = new ArrayList<Map<String, String>>();
    private final String tableAsString;
    private final String headerSeparator;
    private final String valueSeparator;
    private final List<String> headers = new ArrayList<String>();

    public ExamplesTable(String tableAsString) {
        this(tableAsString, HEADER_SEPARATOR, VALUE_SEPARATOR);
    }

    public ExamplesTable(String tableAsString, String headerSeparator, String valueSeparator) {
        this.tableAsString = tableAsString;
        this.headerSeparator = headerSeparator;
        this.valueSeparator = valueSeparator;
        parse();
    }

    private void parse() {
        data.clear();
        String[] rows = tableAsString.trim().split(NEWLINE);
        headers.clear();
        for (int row = 0; row < rows.length; row++) {
            if (row == 0) {
                List<String> columns = columnsFor(rows[row], headerSeparator);
                headers.addAll(columns);
            } else {
                List<String> columns = columnsFor(rows[row], valueSeparator);
                Map<String, String> map = new HashMap<String, String>();
                for (int column = 0; column < columns.size(); column++) {
                    map.put(headers.get(column), columns.get(column));
                }
                data.add(map);
            }
        }
    }

    private List<String> columnsFor(String row, String separator) {
        List<String> columns = new ArrayList<String>();
        for (String column : row.split(buildRegex(separator))) {
            columns.add(column.trim());
        }
        int size = columns.size();
        if (size > 0) {
            columns.remove(0);
        }
        return columns;
    }

    private String buildRegex(String separator) {
        char[] chars = separator.toCharArray();
        StringBuffer sb = new StringBuffer();
        for ( char c : chars ){
            sb.append("\\").append(c);
        }
        return sb.toString();
    }

    public List<String> getHeaders() {
        return headers;
    }

    public Map<String, String> getRow(int row) {
        return data.get(row);
    }

    public int getRowCount() {
        return data.size();
    }

    public List<Map<String, String>> getRows() {
        return data;
    }

    public String getHeaderSeparator() {
        return headerSeparator;
    }

    public String getValueSeparator() {
        return valueSeparator;
    }

    @Override
    public String toString() {
        return tableAsString;
    }

}


import functools
import inspect

from nova.db import base
from nova import exception
from nova.network import model as network_model
from nova.network import rpcapi as network_rpcapi
from nova.openstack.common import log as logging
from nova.openstack.common import rpc

LOG = logging.getLogger(__name__)

def refresh_cache(f):
    """
    Decorator to update the instance_info_cache

    Requires context and instance as function args
    """
    argspec = inspect.getargspec(f)

    @functools.wraps(f)
    def wrapper(self, context, *args, **kwargs):
        res = f(self, context, *args, **kwargs)

        try:
            # get the instance from arguments (or raise ValueError)
            instance = kwargs.get('instance')
            if not instance:
                instance = args[argspec.args.index('instance') - 2]
        except ValueError:
            msg = _('instance is a required argument to use @refresh_cache')
            raise Exception(msg)

        # get nw_info from return if possible, otherwise call for it
        nw_info = res if isinstance(res, network_model.NetworkInfo) else None

        update_instance_cache_with_nw_info(self, context, instance, nw_info,
                                           *args, **kwargs)

        # return the original function's return value
        return res
    return wrapper

def update_instance_cache_with_nw_info(api, context, instance,
                                       nw_info=None,
                                       *args,
                                       **kwargs):

    try:
        nw_info = nw_info or api._get_instance_nw_info(context, instance)

        # update cache
        cache = {'network_info': nw_info.json()}
        api.db.instance_info_cache_update(context, instance['uuid'], cache)
    except Exception as e:
        LOG.exception(_('Failed storing info cache'), instance=instance)
        LOG.debug(_('args: %s') % (args or {}))
        LOG.debug(_('kwargs: %s') % (kwargs or {}))

class API(base.Base):
    """API for interacting with the network manager."""

    def __init__(self, **kwargs):
        self.network_rpcapi = network_rpcapi.NetworkAPI()
        super(API, self).__init__(**kwargs)

    def get_all(self, context):
        return self.network_rpcapi.get_all_networks(context)

    def get(self, context, network_uuid):
        return self.network_rpcapi.get_network(context, network_uuid)

    def create(self, context, **kwargs):
        return self.network_rpcapi.create_networks(context, **kwargs)

    def delete(self, context, network_uuid):
        return self.network_rpcapi.delete_network(context, network_uuid, None)

    def disassociate(self, context, network_uuid):
        return self.network_rpcapi.disassociate_network(context, network_uuid)

    def get_fixed_ip(self, context, id):
        return self.network_rpcapi.get_fixed_ip(context, id)

    def get_fixed_ip_by_address(self, context, address):
        return self.network_rpcapi.get_fixed_ip_by_address(context, address)

    def get_floating_ip(self, context, id):
        return self.network_rpcapi.get_floating_ip(context, id)

    def get_floating_ip_pools(self, context):
        return self.network_rpcapi.get_floating_pools(context)

    def get_floating_ip_by_address(self, context, address):
        return self.network_rpcapi.get_floating_ip_by_address(context, address)

    def get_floating_ips_by_project(self, context):
        return self.network_rpcapi.get_floating_ips_by_project(context)

    def get_floating_ips_by_fixed_address(self, context, fixed_address):
        return self.network_rpcapi.get_floating_ips_by_fixed_address(context,
                fixed_address)

    def get_backdoor_port(self, context, host):
        return self.network_rpcapi.get_backdoor_port(context, host)

    def get_instance_id_by_floating_address(self, context, address):
        # NOTE(tr3buchet): i hate this
        return self.network_rpcapi.get_instance_id_by_floating_address(context,
                address)

    def get_vifs_by_instance(self, context, instance):
        return self.network_rpcapi.get_vifs_by_instance(context,
                instance['id'])

    def get_vif_by_mac_address(self, context, mac_address):
        return self.network_rpcapi.get_vif_by_mac_address(context, mac_address)

    def allocate_floating_ip(self, context, pool=None):
        """Adds a floating ip to a project from a pool. (allocates)"""
        # NOTE(vish): We don't know which network host should get the ip
        #             when we allocate, so just send it to any one.  This
        #             will probably need to move into a network supervisor
        #             at some point.
        return self.network_rpcapi.allocate_floating_ip(context,
                context.project_id, pool, False)

    def release_floating_ip(self, context, address,
                            affect_auto_assigned=False):
        """Removes floating ip with address from a project. (deallocates)"""
        return self.network_rpcapi.deallocate_floating_ip(context, address,
                affect_auto_assigned)

    @refresh_cache
    def associate_floating_ip(self, context, instance,
                              floating_address, fixed_address,
                              affect_auto_assigned=False):
        """Associates a floating ip with a fixed ip.

        ensures floating ip is allocated to the project in context
        """
        orig_instance_uuid = self.network_rpcapi.associate_floating_ip(context,
                floating_address, fixed_address, affect_auto_assigned)

        if orig_instance_uuid:
            msg_dict = dict(address=floating_address,
                            instance_id=orig_instance_uuid)
            LOG.info(_('re-assign floating IP %(address)s from '
                       'instance %(instance_id)s') % msg_dict)
            orig_instance = self.db.instance_get_by_uuid(context,
                                                         orig_instance_uuid)

            # purge cached nw info for the original instance
            update_instance_cache_with_nw_info(self, context, orig_instance)

    @refresh_cache
    def disassociate_floating_ip(self, context, instance, address,
                                 affect_auto_assigned=False):
        """Disassociates a floating ip from fixed ip it is associated with."""
        self.network_rpcapi.disassociate_floating_ip(context, address,
                affect_auto_assigned)

    @refresh_cache
    def allocate_for_instance(self, context, instance, vpn,
                              requested_networks):
        """Allocates all network structures for an instance.

        :returns: network info as from get_instance_nw_info() below
        """
        args = {}
        args['vpn'] = vpn
        args['requested_networks'] = requested_networks
        args['instance_id'] = instance['id']
        args['instance_uuid'] = instance['uuid']
        args['project_id'] = instance['project_id']
        args['host'] = instance['host']
        args['rxtx_factor'] = instance['instance_type']['rxtx_factor']
        nw_info = self.network_rpcapi.allocate_for_instance(context, **args)

        return network_model.NetworkInfo.hydrate(nw_info)

    def deallocate_for_instance(self, context, instance):
        """Deallocates all network structures related to instance."""

        args = {}
        args['instance_id'] = instance['id']
        args['project_id'] = instance['project_id']
        args['host'] = instance['host']
        self.network_rpcapi.deallocate_for_instance(context, **args)

    @refresh_cache
    def add_fixed_ip_to_instance(self, context, instance, network_id):
        """Adds a fixed ip to instance from specified network."""
        args = {'instance_id': instance['id'],
                'host': instance['host'],
                'network_id': network_id}
        self.network_rpcapi.add_fixed_ip_to_instance(context, **args)

    @refresh_cache
    def remove_fixed_ip_from_instance(self, context, instance, address):
        """Removes a fixed ip from instance from specified network."""

        args = {'instance_id': instance['uuid'],
                'host': instance['host'],
                'address': address}
        self.network_rpcapi.remove_fixed_ip_from_instance(context, **args)

    def add_network_to_project(self, context, project_id, network_uuid=None):
        """Force adds another network to a project."""
        self.network_rpcapi.add_network_to_project(context, project_id,
                network_uuid)

    @refresh_cache
    def get_instance_nw_info(self, context, instance):
        """Returns all network info related to an instance."""
        return self._get_instance_nw_info(context, instance)

    def _get_instance_nw_info(self, context, instance):
        """Returns all network info related to an instance."""
        args = {'instance_id': instance['id'],
                'instance_uuid': instance['uuid'],
                'rxtx_factor': instance['instance_type']['rxtx_factor'],
                'host': instance['host'],
                'project_id': instance['project_id']}
        nw_info = self.network_rpcapi.get_instance_nw_info(context, **args)

        return network_model.NetworkInfo.hydrate(nw_info)

    def validate_networks(self, context, requested_networks):
        """validate the networks passed at the time of creating
        the server
        """
        return self.network_rpcapi.validate_networks(context,
                                                     requested_networks)

    def get_instance_uuids_by_ip_filter(self, context, filters):
        """Returns a list of dicts in the form of
        {'instance_uuid': uuid, 'ip': ip} that matched the ip_filter
        """
        return self.network_rpcapi.get_instance_uuids_by_ip_filter(context,
                                                                   filters)

    def get_dns_domains(self, context):
        """Returns a list of available dns domains.
        These can be used to create DNS entries for floating ips.
        """
        return self.network_rpcapi.get_dns_domains(context)

    def add_dns_entry(self, context, address, name, dns_type, domain):
        """Create specified DNS entry for address"""
        args = {'address': address,
                'name': name,
                'dns_type': dns_type,
                'domain': domain}
        return self.network_rpcapi.add_dns_entry(context, **args)

    def modify_dns_entry(self, context, name, address, domain):
        """Create specified DNS entry for address"""
        args = {'address': address,
                'name': name,
                'domain': domain}
        return self.network_rpcapi.modify_dns_entry(context, **args)

    def delete_dns_entry(self, context, name, domain):
        """Delete the specified dns entry."""
        args = {'name': name, 'domain': domain}
        return self.network_rpcapi.delete_dns_entry(context, **args)

    def delete_dns_domain(self, context, domain):
        """Delete the specified dns domain."""
        return self.network_rpcapi.delete_dns_domain(context, domain=domain)

    def get_dns_entries_by_address(self, context, address, domain):
        """Get entries for address and domain"""
        args = {'address': address, 'domain': domain}
        return self.network_rpcapi.get_dns_entries_by_address(context, **args)

    def get_dns_entries_by_name(self, context, name, domain):
        """Get entries for name and domain"""
        args = {'name': name, 'domain': domain}
        return self.network_rpcapi.get_dns_entries_by_name(context, **args)

    def create_private_dns_domain(self, context, domain, availability_zone):
        """Create a private DNS domain with nova availability zone."""
        args = {'domain': domain, 'av_zone': availability_zone}
        return self.network_rpcapi.create_private_dns_domain(context, **args)

    def create_public_dns_domain(self, context, domain, project=None):
        """Create a public DNS domain with optional nova project."""
        args = {'domain': domain, 'project': project}
        return self.network_rpcapi.create_public_dns_domain(context, **args)

    def setup_networks_on_host(self, context, instance, host=None,
                                                        teardown=False):
        """Setup or teardown the network structures on hosts related to
           instance"""
        host = host or instance['host']
        # NOTE(tr3buchet): host is passed in cases where we need to setup
        # or teardown the networks on a host which has been migrated to/from
        # and instance['host'] is not yet or is no longer equal to
        args = {'instance_id': instance['id'],
                'host': host,
                'teardown': teardown}

        self.network_rpcapi.setup_networks_on_host(context, **args)

    def _is_multi_host(self, context, instance):
        try:
            fixed_ips = self.db.fixed_ip_get_by_instance(context,
                                                         instance['uuid'])
        except exception.FixedIpNotFoundForInstance:
            return False
        network = self.db.network_get(context, fixed_ips[0]['network_id'],
                                      project_only='allow_none')
        return network['multi_host']

    def _get_floating_ip_addresses(self, context, instance):
        floating_ips = self.db.instance_floating_address_get_all(context,
                                                            instance['uuid'])
        return [floating_ip['address'] for floating_ip in floating_ips]

    def migrate_instance_start(self, context, instance, migration):
        """Start to migrate the network of an instance"""
        args = dict(
            instance_uuid=instance['uuid'],
            rxtx_factor=instance['instance_type']['rxtx_factor'],
            project_id=instance['project_id'],
            source_compute=migration['source_compute'],
            dest_compute=migration['dest_compute'],
            floating_addresses=None,
        )

        if self._is_multi_host(context, instance):
            args['floating_addresses'] = \
                self._get_floating_ip_addresses(context, instance)
            args['host'] = migration['source_compute']

        self.network_rpcapi.migrate_instance_start(context, **args)

    def migrate_instance_finish(self, context, instance, migration):
        """Finish migrating the network of an instance"""
        args = dict(
            instance_uuid=instance['uuid'],
            rxtx_factor=instance['instance_type']['rxtx_factor'],
            project_id=instance['project_id'],
            source_compute=migration['source_compute'],
            dest_compute=migration['dest_compute'],
            floating_addresses=None,
        )

        if self._is_multi_host(context, instance):
            args['floating_addresses'] = \
                self._get_floating_ip_addresses(context, instance)
            args['host'] = migration['dest_compute']

        self.network_rpcapi.migrate_instance_finish(context, **args)


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

    <title>statsmodels.duration.hazard_regression.PHReg.score_residuals — statsmodels 0.8.0 documentation</title>

    <link rel="stylesheet" href="../_static/nature.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />

    <link rel="shortcut icon" href="../_static/statsmodels_hybi_favico.ico"/>
    <link rel="author" title="About these documents" href="../about.html" />
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="statsmodels.duration.hazard_regression.PHReg.weighted_covariate_averages" href="statsmodels.duration.hazard_regression.PHReg.weighted_covariate_averages.html" />
    <link rel="prev" title="statsmodels.duration.hazard_regression.PHReg.score" href="statsmodels.duration.hazard_regression.PHReg.score.html" />
<link rel="stylesheet" href="../_static/examples.css" type="text/css" />
<link rel="stylesheet" href="../_static/facebox.css" type="text/css" />

Navigation

          index

          modules |

          next |

          previous |

Install
  |

Support
  |

Bugs
  |

Develop
  |

Examples
  |

FAQ
  |

Methods for Survival and Duration Analysis |

statsmodels.duration.hazard_regression.PHReg |

statsmodels.duration.hazard_regression.PHReg.score_residuals¶

PHReg.score_residuals(params)[source]¶

Returns the score residuals calculated at a given vector of
parameters.

<col class="field-name" />
<col class="field-body" />

Parameters:
params : ndarray

The parameter vector at which the score residuals are
calculated.

Returns:
The score residuals, returned as a ndarray having the same

shape as exog.

Notes

Observations in a stratum with no observed events have undefined
score residuals, and contain NaN in the returned matrix.

Previous topic

statsmodels.duration.hazard_regression.PHReg.score

Next topic

statsmodels.duration.hazard_regression.PHReg.weighted_covariate_averages

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">

<input type="text" name="q" />

<input type="submit" value="Go" />

      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>

        © Copyright 2009-2017, Josef Perktold, Skipper Seabold, Jonathan Taylor, statsmodels-developers.
      Created using Sphinx 1.5.3.


<?php
/*
Unsafe sample
input : get the field userData from the variable $_GET via an object, which store it in a array
sanitize : use of the function htmlentities. Sanitizes the query but has a high chance to produce unexpected results
construction : concatenation with simple quote
*/

/*Copyright 2015 Bertrand STIVALET

Permission is hereby granted, without written agreement or royalty fee, to

use, copy, modify, and distribute this software and its documentation for

any purpose, provided that the above copyright notice and the following

three paragraphs appear in all copies of this software.

IN NO EVENT SHALL AUTHORS BE LIABLE TO ANY PARTY FOR DIRECT,

INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE

USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF AUTHORS HAVE

BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

AUTHORS SPECIFICALLY DISCLAIM ANY WARRANTIES INCLUDING, BUT NOT

LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A

PARTICULAR PURPOSE, AND NON-INFRINGEMENT.

THE SOFTWARE IS PROVIDED ON AN "AS-IS" BASIS AND AUTHORS HAVE NO

OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR

MODIFICATIONS.*/

class Input{
  private $input;

  public function getInput(){
    return $this->input['realOne'];
  }

  public  function __construct(){
    $this->input = array();
    $this->input['test']= 'safe' ;
    $this->input['realOne']= $_GET['UserData'] ;
    $this->input['trap']= 'safe' ;
  }
}
$temp = new Input();
$tainted =  $temp->getInput();

$tainted = htmlentities($tainted, ENT_QUOTES);

$query = "(&(objectCategory=person)(objectClass=user)(cn='". $tainted . "'))";

//flaw
$ds=ldap_connect("localhost");
$r=ldap_bind($ds);
$sr=ldap_search($ds,"o=My Company, c=US", $query);
ldap_close($ds);

?>


import re

# Each definition can be one of the following:
# - a string
# - a regex string
# - a function that takes source as a parameter and returns an array or a string.  (You may assume that re and urllib are already imported.)
# If you comment out a parameter, it will use the default defined in __init__.py

# identifier (default = name of this plugin after "plugin_") : If there's a match, we'll attempt to download images using this plugin.

# title: parses the gallery page for a title.  This will be the folder name of the output gallery.
title = r'<title>(.*?)</title>'

# redirect: if the links in the gallery page go to an html instead of an image, use this to parse the gallery page.
redirect = r'href=["\']([^<]+?)["\'][^<]*?><img'

# direct_links: if redirect is non-empty, this parses each redirect page for a single image.  Otherwise, this parses the gallery page for all images.
def direct_links(source):
    matcher = re.compile(r'src=[\"\'](.+?\.jpe?g)[\"\']',re.I)
    links = matcher.findall(source)
    links = filter(lambda x: not "thumb" in x.lower(), links) # exclude thumbnails
    return links

# same_filename (default=False): if True, uses filename specified on remote link.  Otherwise, creates own filename with incremental index.
same_filename = True


module Stattleship
  class BasketballGameLog < Stattleship::GameLog
    def stats
      [
        "#{field_goals_made.to_i} FGM",
        "#{(field_goals_pct.to_f * 100).round(1)} FG%",
        "#{points.to_i} PTS",
        "#{rebounds_total.to_i} RBD",
        "#{assists.to_i} A",
        "#{steals.to_i} STL",
        "#{blocks.to_i} BLK"
      ]
    end

    def to_sentence
      "#{player_name} #{stats.join(', ')} (#{game.name})"
    end
  end

  class BasketballGameLogs < Stattleship::GameLogs
    BASKETBALL_GAME_LOGS = 'basketball/nba/game_logs'.freeze

    def self.fetch(params:)
      super(path: BASKETBALL_GAME_LOGS,
            params: params)
    end
  end

  module BasketballGameLogsRepresenter
    include Roar::JSON
    include Roar::Coercion
    include Stattleship::GameLogsRepresenter
    include Virtus.model

    collection :game_logs, class: Stattleship::BasketballGameLog do

      [
        :away_team_outcome,
        :home_team_outcome,
        :team_outcome,
        :opponent_outcome,
      ].each do |attribute|
        property attribute
      end

      [
        :field_goals_pct,
        :free_throws_pct,
        :three_pointers_pct,
      ].each do |attribute|
        property attribute, type: BigDecimal
      end

      [
        :game_played,
        :game_started,
        :home_team_score,
        :away_team_score,
        :team_score,
        :opponent_score,
        :assists,
        :field_goals_attempted,
        :field_goals_made,
        :free_throws_attempted,
        :free_throws_made,
        :points,
        :three_pointers_attempted,
        :three_pointers_made,
        :turnovers,
        :steals,
        :blocks,
        :personal_fouls,
        :technical_fouls,
        :time_played_total,
        :plus_minus,
        :disqualifications,
        :rebounds_defensive,
        :rebounds_offensive,
        :rebounds_total,
        :double_double,
        :double_triple_double,
        :double_twenty,
        :five_by_five,
        :five_by_seven,
        :five_by_six,
        :five_by_steals_blocks,
        :quadruple_double,
        :quintuple_double,
        :thirty_thirty,
        :triple_double,
      ].each do |attribute|
        property attribute, type: Integer
      end

      [
        :is_home_team,
        :is_away_team,
      ].each do |attribute|
        property attribute, type: Boolean, default: false
      end

      [
        :player_id,
        :game_id,
        :team_id
      ].each do |relationship|
        property relationship
      end
    end
  end
end


To run example code in this directory, invoke your python interpreter in the
top-level directory with following arguments:

```
python -m chapter_03.main
```


SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
null

#### Original name
null

### Remarks
null

life/Plantae/Magnoliophyta/Liliopsida/Asparagales/Orchidaceae/Deiregyne/Deiregyne densiflora/ Syn. Stenorrhynchos densiflorum/README.md


<?php

namespace Pilulka\Database;

class Hydrator
{

    public static function hydrate($class, $row)
    {
        $model = (new \ReflectionClass($class))->newInstance();
        $property = new \ReflectionProperty($class, 'row');
        $property->setAccessible(true);
        $property->setValue($model, $row);
        return $model;
    }

}


package com.capitalone.dashboard.repository;

import java.util.List;

import org.bson.types.ObjectId;
import org.springframework.data.mongodb.repository.Query;

import com.capitalone.dashboard.model.TeamCollectorItem;

/**
 * CollectorItem repository for {@link TeamCollectorItem}.
 */
public interface TeamRepository extends
		BaseCollectorItemRepository<TeamCollectorItem> {
	@Query(value = "{ 'collectorId' : ?0, options.teamId : ?1, options.name : ?2}")
	TeamCollectorItem findTeamCollector(ObjectId collectorId, String teamId,
			String name);

	@Query(value = "{ 'collectorId' : ?0, options.teamId : ?1, enabled: true}")
	List<TeamCollectorItem> findEnabledTeamCollectors(ObjectId collectorId,
			String teamId);

	@Query(value = "{ $query: { 'collectorId' : ?0, 'options.changeDate' : {$gt: ?1}, '_class' : 'com.capitalone.dashboard.model.TeamCollectorItem'}, $orderby: { 'options.changeDate' :-1 }}", fields = "{'options.changeDate' : 1, '_id' : 0}")
	List<TeamCollectorItem> getTeamMaxChangeDate(ObjectId collectorId,
			String lastChangeDate);

	@Query(value = "{'options.teamId' : ?0}")
	List<TeamCollectorItem> getTeamIdById(String teamId);
}


<?php
/**
 * Logos public part.
 */

// File Security Check
if ( ! defined( 'ABSPATH' ) ) { exit; }

class Presscore_Mod_Logos_Public {

	public function register_shortcodes() {
		foreach ( array( 'logos' ) as $shortcode_name ) {
			include_once plugin_dir_path( __FILE__ ) . "shortcodes/{$shortcode_name}/{$shortcode_name}.php";
		}
	}

	public function load_shortcodes_vc_bridge() {
		include_once plugin_dir_path( __FILE__ ) . "shortcodes/mod-logos-shortcodes-bridge.php";
	}

	public function init_widgets() {
		register_widget( 'Presscore_Inc_Widgets_Logos' );
	}
}


OpenCV-Face-andmore-Tracker
===========================

OpenCV based face (and eye, nose, mouth) detection example application. The tutorial is provided as ready to compile/run Windows Visual Studio project (C#, .NET, EmguCV). Just download, compile and have fun with it. Or use the provided binary setup and play webcam face tracking right away.


import React from 'react'
import CalloutSection from '~/components/callout';
import MainCarousel from '~/components/main-carousel';
import { ServicesSection } from '~/components/services';
import { NewsSection } from '~/components/news';
import  Icon  from "~/components/icon";
import { Box, Flex } from 'rebass';
import Heading from '~/components/heading';
import PageSection from "~/components/page-section";
import { Circle } from 'rebass';
import { darken, lighten } from 'polished';
import styled, { withTheme }  from 'styled-components';

const VisaLink = styled.a`
display:block;
  text-decoration:none;
  &:hover {
    ${ Box }{
      background-color: ${ ({theme}) => theme.colors.primaryAccent };
      transition: all 0.3s ease-in-out;
      border-color: ${({ theme }) => darken(0.1, theme.colors.primaryAccent )};
    }
    ${ Icon }{
      color: ${({ theme }) => darken(0.35, theme.colors.primaryAccent )};
    }

    ${ Heading }{
      color: ${ ({theme}) => theme.colors.primaryAccent };
    }

  };

  width:100%;
  height:100%;
`

const StyledBox = styled(Box)`
  line-height: 1em;
  width: 1em;
  height: 1em;
  font-size:6em;
  border-radius: 10px;
  border:solid 2px ${ ({theme}) => darken(0.05, theme.colors.light ) };
  display: inline-flex;
  border-radius: 50%;
  background-color: ${ ({ theme }) => theme.colors.light };
`

const StyledIcon = styled(Icon)`
  display:block;
  width:100%;
  height:100%;
  font-size: 0.5em;
  margin-top:-5px;
  color: ${({theme}) => theme.colors.dark };
`

const Visa = withTheme(({title, slug, icon, theme}) => {
  return (
  <Box w={[1, 1/2, 1/3, 1/5]} mb={[5, 6]} style={{ textAlign: "center"}}>
    <VisaLink href={slug}>
      <StyledBox ><StyledIcon color="dark"  icon={icon}></StyledIcon></StyledBox>
      <Heading f={[1, 2, 3, 4]}>{title}</Heading>
    </VisaLink>
  </Box>
)
});

const VisaSection = withTheme(({visas, theme}) =>{
  const children = visas.map(visa => (<Visa key={visa.id} {...visa}/>));
  return (<Flex style={{ borderTop: "solid 1px " + darken(0.1, theme.colors.light ) }} wrap pt={6}>
    {children}
  </Flex>)
});

export default ({data}) => {
   const services = data.services.edges.map(x => ({ ...x.node.frontmatter, id:x.node.id, slug: x.node.fields.slug }));
   const news = data.news.edges.map(x => ({ ...x.node.frontmatter, id:x.node.id, slug: x.node.fields.slug, excerpt: x.node.excerpt }));
   const visas = data.visas.edges.concat(data.citizenship.edges).map(x => ({ ...x.node.frontmatter, id:x.node.id, slug: x.node.fields.slug }));

return (
    <div>
      <MainCarousel/>
      <ServicesSection services={services}/>
      <VisaSection visas={visas} />
      <CalloutSection/>
      <NewsSection news={news} py={5} />
    </div>
  )
}

export const pageQuery = graphql`
    fragment Content on MarkdownRemarkEdge{
      node{
        fields{
          area,
          slug
        },
        id,
        frontmatter{
          title,
          caption,
          extract,
          image,
          thumb,
          tags,
          date,
          order,
          icon,
          thumbPosition
        }
      }
    }

query LandingQuery {
    services:allMarkdownRemark(
        limit: 100
        filter:{ fields: { area: { eq: "services" } }}
        sort: { fields: [frontmatter___order], order: ASC }
    ) {
      edges {
       ...Content
      }
  },
  visas:allMarkdownRemark(
    limit: 100
    filter:{ fields: { area: { eq: "visas" } }}
    sort: { fields: [frontmatter___order], order: ASC }
  ) {
    edges {
    ...Content
    }
  },
  citizenship: allMarkdownRemark(
    limit: 100
    filter:{ fields: { area: { eq: "citizenship" } }}
    sort: { fields: [frontmatter___order], order: ASC }
  ) {
    edges {
    ...Content
    }
  },
  news:allMarkdownRemark(
      limit: 100
      filter:{ fields: { area: { eq: "news" } }}
      sort: { fields: [frontmatter___date],  order: DESC }
  ) {
    edges {
      ...Content,
      node{
        excerpt(pruneLength: 350)
      }
    }
  }
}`;


layout: post
name: "Invoice"
title: "Invoice – August 2019"
date: 2019-08-31 10:00:00
invoice_number: "naluri-2019-8-31-CG"
period: "August 2019"
pdf_url: "/pdfs/2019-08-31-invoice.pdf"
invoice_currency: RM
hourly_rate: 1500
person_name: Code Hero Enterprise
person_email: fai@code3.io
client: Naluri Sdn Bhd
note:
excerpt_separator: ""
invoice_line_items:
- title: August 2019 (Tech / Infra support / advice)
  amount: 1500

invoice_payment_info: |
  __Account Name:__ CODE HERO ENTERPRISE \\
  __Account Bank Name:__ MAYBANK MALAYSIA    \\
  __Account Number:__    562106693095   \\
  __Account Country:__   Malaysia         \\
  __Account Address:__   \\
  SA1-8-3A Vista Alam, \\
  Jalan Ikhtisas, Seksyen 14, \\
  40000 Shah Alam, \\
  Selangor, Malaysia.

exchange_rate: 0.0
exchange_currency:
address:
...

---

# {{page.title}}

## Description

This invoice is for work performed by _{{page.person_name}}_ for _{{page.client}}_.

__Invoice Number:__ {{ page.invoice_number }} \\
__Date:__ {{ page.date | date_to_string }} \\
__For period:__ {{ page.period }}

{{page.note}}

## Line items

{% assign total = 0 %}
|__Description__|__Total__|
|---|---:|{% for item in page.invoice_line_items %}{% assign total = total | plus:item.amount %}
|{{item.title}}|{{item.amount}}|{% endfor %}
||__{{total}} {{page.invoice_currency}}__|

{% if page.exchange_rate > 0 %}
Exchange Rate {{page.exchange_rate}}, total payable in {{page.exchange_currency}}, **{{total | times:page.exchange_rate | round}} {{page.exchange_currency}}**
{% endif %}

## Bank Information

{{page.invoice_payment_info}}


::ApplicationController.class_eval do

  around_filter :scope_current_patron

	def current_patron
		if user_signed_in?
			@current_patron ||= begin
				patron_id = warden.user(:scope => :patron) #|| (current_user.patron_id if current_user)
				Nimbos::Patron.find(patron_id)
			end
		end
	end
	helper_method :current_patron

	def current_user
		if user_signed_in?
			@current_user ||= begin
				user_id = warden.user(:scope => :user)
				Nimbos::User.unscoped.find(user_id)
			end
		end
	end
	helper_method :current_user

	def user_signed_in?
    warden.authenticated?(:user)
  end
  helper_method :user_signed_in?

  def require_login
    unless user_signed_in?
    	session[:return_to_url] = request.url if request.get?
    	not_authenticated
    else
    	if current_user.is_guest
    		session[:return_to_url] = nil
    		warden.logout
    		redirect_to main_app.root_url
    	end
    end
  end

	def force_authentication!(patron, user)
		warden.set_user(user.id, :scope => :user)
		warden.set_user(patron.id, :scope => :patron)
	end

	def generate_group(parent, user_ids)
		#user_ids << current_user.id
    Nimbos::Group.add_group(current_user.id, parent, user_ids)
	end

private
	def not_authenticated
	  redirect_to nimbos.login_path, :alert => "Please login first."
	end

  def warden
    env['warden']
  end

  def scope_current_patron
    Nimbos::Patron.current_id = current_patron.id if current_patron
    yield
  ensure
    Nimbos::Patron.current_id = nil
  end
end


// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE        139
#define _APS_NEXT_COMMAND_VALUE         32778
#define _APS_NEXT_CONTROL_VALUE         1043
#define _APS_NEXT_SYMED_VALUE           110
#endif
#endif

HeadsetPresenter_Bluetools/Microsoft Speech SDK 5.1/Samples/CPP/Reco/resource.h


package io.tvcalendar.security;

import org.springframework.security.core.AuthenticationException;

/**
 * This exception is throw in case of a not activated user trying to authenticate.
 */
public class UserNotActivatedException extends AuthenticationException {

    public UserNotActivatedException(String message) {
        super(message);
    }

    public UserNotActivatedException(String message, Throwable t) {
        super(message, t);
    }
}


package com.example.fraud.model;

import com.fasterxml.jackson.annotation.JsonProperty;

public class FraudCheckResult {

	private FraudCheckStatus fraudCheckStatus;

	@JsonProperty("rejection.reason")
	private String rejectionReason;

	public FraudCheckResult() {
	}

	public FraudCheckResult(FraudCheckStatus fraudCheckStatus, String rejectionReason) {
		this.fraudCheckStatus = fraudCheckStatus;
		this.rejectionReason = rejectionReason;
	}

	public FraudCheckStatus getFraudCheckStatus() {
		return fraudCheckStatus;
	}

	public void setFraudCheckStatus(FraudCheckStatus fraudCheckStatus) {
		this.fraudCheckStatus = fraudCheckStatus;
	}

	public String getRejectionReason() {
		return rejectionReason;
	}

	public void setRejectionReason(String rejectionReason) {
		this.rejectionReason = rejectionReason;
	}

}


using System;
using System.Collections.Generic;

namespace Web_API_Service.Models
{
    // Models returned by AccountController actions.

    public class ExternalLoginViewModel
    {
        public string Name { get; set; }

        public string Url { get; set; }

        public string State { get; set; }
    }

    public class ManageInfoViewModel
    {
        public string LocalLoginProvider { get; set; }

        public string Email { get; set; }

        public IEnumerable<UserLoginInfoViewModel> Logins { get; set; }

        public IEnumerable<ExternalLoginViewModel> ExternalLoginProviders { get; set; }
    }

    public class UserInfoViewModel
    {
        public string Email { get; set; }

        public bool HasRegistered { get; set; }

        public string LoginProvider { get; set; }
    }

    public class UserLoginInfoViewModel
    {
        public string LoginProvider { get; set; }

        public string ProviderKey { get; set; }
    }
}


<?php
header("Content-Type: application/json"); //Set header for outputing the JSON information
require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/autoload.php';
$request = file_get_contents('php://input');
$data = json_decode($request);
$notification_id = $data->notification_id;
//$notification_id = 36;
$user = User::get_current_user();
try {
	if (is_numeric($notification_id) && $user instanceof CurrentUser) {
		$notification = new Notification(array(
			'notification_id' => $notification_id)
		);
		$result = $user->mark_notification_as_read($notification);
		http_response_code(200);
	}
	else {
		throw new UnexpectedValueException('UnexpectedValueException occured on request because the input parameters are invalid');
	}
}
catch (Exception $e) {
	http_response_code(400);
	Database::print_exception($e);
}


package org.tecunhuman;

import org.tecunhuman.jni.SoundStretch;

public class AndroidJNI {
    public final static SoundStretch soundStretch = new SoundStretch();
}


{-# LANGUAGE TemplateHaskell, DeriveGeneric, DeriveDataTypeable #-}
module Master.Master
       ( run
       , remoteTable
       ) where

import Control.Distributed.Process ( Process, NodeId, RemoteTable
                                   , NodeMonitorNotification (..)
                                   , ProcessMonitorNotification (..)
                                   , DiedReason (..), ProcessId (..)
                                   , say, spawnSupervised, spawnLocal
                                   , getSelfPid, send, nsend, expect
                                   , receiveWait
                                   , match, monitorNode
                                   , register )
import Control.Distributed.Process.Closure
import Control.Distributed.Process.Backend.SimpleLocalnet ( Backend
                                                          , findSlaves
                                                          , terminateAllSlaves )
import Control.Monad (forever)
import Data.List ((\\))
import Data.Binary
import Data.Typeable
import Text.Printf (printf)

import GHC.Generics

import Slave.Slave (Request (..), Response (..), slaveProc, slaveProc__static)

data NodeDetected =
  NodeDetected !NodeId
    deriving (Generic, Typeable)

instance Binary NodeDetected

data ProcessUp =
  ProcessUp !ProcessId
    deriving (Generic, Typeable)

instance Binary ProcessUp

data ProcessDown =
  ProcessDown !ProcessId
    deriving (Generic, Typeable)

instance Binary ProcessDown

nodeDetector :: Backend -> Process ()
nodeDetector backend = loop []
  where
    loop :: [NodeId] -> Process ()
    loop nodes = do
      nodes' <- map processNodeId `fmap` findSlaves backend
      mapM_ (nsend "supervisor" . NodeDetected) $ nodes' \\ nodes
      loop nodes'

supervisor :: Process ()
supervisor = do
  register "supervisor" =<< getSelfPid
  forever $
    receiveWait
    [ match nodeDetected
    , match nodeMonitorNotification
    , match processMonitorNotification
    ]

taskMaster :: Process ()
taskMaster = do
  say "taskMaster"
  taskMaster' [] [1..100] []

taskMaster' :: [ProcessId] -> [Int] -> [Int] -> Process ()
taskMaster' [] xs ys = do
  -- No processes are available, wait infinitely for one process to
  -- show up.
  say "Waiting for procs"
  ProcessUp processId <- expect
  say "Got proc"
  taskMaster' [processId] xs ys

taskMaster' procs [] ys
  | length ys == 100 = do
    say "Work is done!"
    return ()
  | otherwise        = do
    -- We still have to receive responses from processes.
    say "Waiting for the last response(s)"
    Response y <- expect
    say $ printf "Got response: %d" y
    taskMaster' procs [] (y:ys)

taskMaster' procs@(p:ps) s@(x:xs) ys
  | length s + length ys < 80 = do
    -- Too many in flight, don't send more.
    say "Too many in flight. Waiting for various responses"
    (procs', s', ys') <- receiveWait
                        [ match $ \(ProcessDown pid) -> do
                             say $ printf "Lost process %s" (show pid)
                             return $ (filter (pid /=) procs, s, ys)
                        , match $ \(ProcessUp pid) -> do
                             say $ printf "Got process %s" (show pid)
                             return $ ((pid:procs), s, ys)
                        , match $ \(Response y) -> do
                             say $ printf "Got response %d" y
                             return $ (procs, s, (y:ys))
                        ]
    taskMaster' procs' s' ys'
  | otherwise                 = do
    say "Send one request"
    self <- getSelfPid
    send p $ Request self x
    taskMaster' (ps ++ [p]) xs ys

nodeDetected :: NodeDetected -> Process ()
nodeDetected (NodeDetected nodeId) = do
  say $ "Detected node: " ++ show nodeId
  _ <- monitorNode nodeId
  (newProc, _) <- spawnSupervised nodeId $(mkStaticClosure 'slaveProc)
  nsend "taskmaster" $ ProcessUp newProc
  say $ printf "Create process %s at node %s" (show newProc) (show nodeId)
  return ()

nodeMonitorNotification :: NodeMonitorNotification -> Process ()
nodeMonitorNotification (NodeMonitorNotification _ nodeId reason) =
  say $ printf "Node %s died because of %s" (show nodeId) (show reason)

processMonitorNotification :: ProcessMonitorNotification -> Process ()
processMonitorNotification (ProcessMonitorNotification _  processId reason) =
  case reason of
    (DiedException _) -> do
      say $ printf "Process %s crashed and will be restarted"
                       (show processId)
      nsend "taskmaster" $ ProcessDown processId
      (newProc, _) <- spawnSupervised (processNodeId processId)
                                      $(mkStaticClosure 'slaveProc)
      nsend "taskmaster" $ ProcessUp newProc
    _              -> do
      say $ printf "Process %s died because of %s" (show processId)
                                                   (show reason)
      nsend "taskmaster" $ ProcessDown processId

remotable []

remoteTable :: (RemoteTable -> RemoteTable)
remoteTable = __remoteTable

run :: Backend -> [NodeId] -> Process ()
run backend  _ = do
  register "taskmaster" =<< getSelfPid
  _ <- spawnLocal supervisor
  _ <- spawnLocal (nodeDetector backend)
  taskMaster
  terminateAllSlaves backend


/*	$NetBSD: l2cap_misc.c,v 1.7 2009/09/13 18:45:11 pooka Exp $	*/

/*-
 * Copyright (c) 2005 Iain Hibbert.
 * Copyright (c) 2006 Itronix Inc.
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. The name of Itronix Inc. may not be used to endorse
 *    or promote products derived from this software without specific
 *    prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY ITRONIX INC. ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL ITRONIX INC. BE LIABLE FOR ANY
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 * ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: l2cap_misc.c,v 1.7 2009/09/13 18:45:11 pooka Exp $");

#include <sys/param.h>
#include <sys/kernel.h>
#include <sys/mbuf.h>
#include <sys/proc.h>
#include <sys/queue.h>
#include <sys/systm.h>

#include <netbt/bluetooth.h>
#include <netbt/hci.h>
#include <netbt/l2cap.h>

struct l2cap_channel_list
	l2cap_active_list = LIST_HEAD_INITIALIZER(l2cap_active_list);
struct l2cap_channel_list
	l2cap_listen_list = LIST_HEAD_INITIALIZER(l2cap_listen_list);

struct pool l2cap_req_pool, l2cap_pdu_pool;

const l2cap_qos_t l2cap_default_qos = {
	0,			/* flags */
	L2CAP_QOS_BEST_EFFORT,	/* service type */
	0x00000000,		/* token rate */
	0x00000000,		/* token bucket size */
	0x00000000,		/* peak bandwidth */
	0xffffffff,		/* latency */
	0xffffffff		/* delay variation */
};

/*
 * L2CAP request timeouts
 */
int l2cap_response_timeout = 30;		/* seconds */
int l2cap_response_extended_timeout = 180;	/* seconds */

void
l2cap_init(void)
{

	pool_init(&l2cap_req_pool, sizeof(struct l2cap_req), 0, 0, 0,
	    "l2cap_req", NULL, IPL_SOFTNET);
	pool_init(&l2cap_pdu_pool, sizeof(struct l2cap_pdu), 0, 0, 0,
	    "l2cap_pdu", NULL, IPL_SOFTNET);
}

/*
 * Set Link Mode on channel
 */
int
l2cap_setmode(struct l2cap_channel *chan)
{

	KASSERT(chan != NULL);
	KASSERT(chan->lc_link != NULL);

	DPRINTF("CID #%d, auth %s, encrypt %s, secure %s\n", chan->lc_lcid,
		(chan->lc_mode & L2CAP_LM_AUTH ? "yes" : "no"),
		(chan->lc_mode & L2CAP_LM_ENCRYPT ? "yes" : "no"),
		(chan->lc_mode & L2CAP_LM_SECURE ? "yes" : "no"));

	if (chan->lc_mode & L2CAP_LM_AUTH)
		chan->lc_link->hl_flags |= HCI_LINK_AUTH_REQ;

	if (chan->lc_mode & L2CAP_LM_ENCRYPT)
		chan->lc_link->hl_flags |= HCI_LINK_ENCRYPT_REQ;

	if (chan->lc_mode & L2CAP_LM_SECURE)
		chan->lc_link->hl_flags |= HCI_LINK_SECURE_REQ;

	return hci_acl_setmode(chan->lc_link);
}

/*
 * Allocate a new Request structure & ID and set the timer going
 */
int
l2cap_request_alloc(struct l2cap_channel *chan, uint8_t code)
{
	struct hci_link *link = chan->lc_link;
	struct l2cap_req *req;
	int next_id;

	if (link == NULL)
		return ENETDOWN;

	/* find next ID (0 is not allowed) */
	next_id = link->hl_lastid + 1;
	if (next_id > 0xff)
		next_id = 1;

	/* Ouroboros check */
	req = TAILQ_FIRST(&link->hl_reqs);
	if (req && req->lr_id == next_id)
		return ENFILE;

	req = pool_get(&l2cap_req_pool, PR_NOWAIT);
	if (req == NULL)
		return ENOMEM;

	req->lr_id = link->hl_lastid = next_id;

	req->lr_code = code;
	req->lr_chan = chan;
	req->lr_link = link;

	callout_init(&req->lr_rtx, 0);
	callout_setfunc(&req->lr_rtx, l2cap_rtx, req);
	callout_schedule(&req->lr_rtx, l2cap_response_timeout * hz);

	TAILQ_INSERT_TAIL(&link->hl_reqs, req, lr_next);

	return 0;
}

/*
 * Find a running request for this link
 */
struct l2cap_req *
l2cap_request_lookup(struct hci_link *link, uint8_t id)
{
	struct l2cap_req *req;

	TAILQ_FOREACH(req, &link->hl_reqs, lr_next) {
		if (req->lr_id == id)
			return req;
	}

	return NULL;
}

/*
 * Halt and free a request
 */
void
l2cap_request_free(struct l2cap_req *req)
{
	struct hci_link *link = req->lr_link;

	callout_stop(&req->lr_rtx);
	if (callout_invoking(&req->lr_rtx))
		return;

	callout_destroy(&req->lr_rtx);

	TAILQ_REMOVE(&link->hl_reqs, req, lr_next);
	pool_put(&l2cap_req_pool, req);
}

/*
 * Response Timeout eXpired
 *
 * No response to our request, so deal with it as best we can.
 *
 * XXX should try again at least with ertx?
 */
void
l2cap_rtx(void *arg)
{
	struct l2cap_req *req = arg;
	struct l2cap_channel *chan;

	mutex_enter(bt_lock);
	callout_ack(&req->lr_rtx);

	chan = req->lr_chan;
	l2cap_request_free(req);

	DPRINTF("cid %d, ident %d\n", (chan ? chan->lc_lcid : 0), req->lr_id);

	if (chan && chan->lc_state != L2CAP_CLOSED)
		l2cap_close(chan, ETIMEDOUT);

	mutex_exit(bt_lock);
}

/*
 * Allocate next available CID to channel. We keep a single
 * ordered list of channels, so find the first gap.
 *
 * If this turns out to be not enough (!), could use a
 * list per HCI unit..
 */
int
l2cap_cid_alloc(struct l2cap_channel *chan)
{
	struct l2cap_channel *used, *prev = NULL;
	uint16_t cid = L2CAP_FIRST_CID;

	if (chan->lc_lcid != L2CAP_NULL_CID || chan->lc_state != L2CAP_CLOSED)
		return EISCONN;

	LIST_FOREACH(used, &l2cap_active_list, lc_ncid) {
		if (used->lc_lcid > cid)
			break;	/* found our gap */

		KASSERT(used->lc_lcid == cid);
		cid++;

		if (cid == L2CAP_LAST_CID)
			return ENFILE;

		prev = used;	/* for insert after */
	}

	chan->lc_lcid = cid;

	if (prev)
		LIST_INSERT_AFTER(prev, chan, lc_ncid);
	else
		LIST_INSERT_HEAD(&l2cap_active_list, chan, lc_ncid);

	return 0;
}

/*
 * Find channel with CID
 */
struct l2cap_channel *
l2cap_cid_lookup(uint16_t cid)
{
	struct l2cap_channel *chan;

	LIST_FOREACH(chan, &l2cap_active_list, lc_ncid) {
		if (chan->lc_lcid == cid)
			return chan;

		if (chan->lc_lcid > cid)
			return NULL;
	}

	return NULL;
}


Playing around with resource based routing in MVC 6/ASP.NET 5


<?php

namespace app;

require_once __DIR__ . '/../composer_modules/autoload.php';

class ClasseTwigExtension extends \Slim\Views\TwigExtension {

    public function getName() {
        return 'classe-twig-extension';
    }

    public function getFilters() {
        return array(
            new \Twig_SimpleFilter('md5', 'md5_file'),
        );
    }

}

//EOF


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% RESULTS
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%
% FraCaS INTRO
%%%%%%%%%%%%%%%%%%%
\begin{frame}{Experiments}
\hh{FraCaS Textual Entailment Suite:}
\begin{itemize}
  \item Used in MacCartney and Manning (2007; 2008).
  \item RTE-style problems: is the hypothesis entailed from the premise? \\
    \vspace{0.1cm}
    P: At least three commissioners spend a lot of time at home. \\
    H: \true{At least three commissioners spend time at home.} \\
    \vspace{0.1cm}
    P: At most ten commissioners spend a lot of time at home. \\
    H: \false{At most ten commissioners spend time at home.}
    \vspace{0.1cm}
  \item 9 focused sections; 3 in scope for this work.
\end{itemize}
\vspace{0.5cm}
\pause

\hh{\textbf{Not} a blind test set!}
\begin{itemize}
  \item ``Can we make deep inferences without knowing the premise \textit{a priori}?''
\end{itemize}
\end{frame}

%%%%%%%%%%%%%%%%%%%
% FraCaS RESULTS
%%%%%%%%%%%%%%%%%%%
\def\a#1{#1}
\def\b#1{\textbf{#1}}
\begin{frame}{FraCaS Results}

\hh{Systems}
\begin{itemize}
\item[] \textbf{M07}: MacCartney and Manning (2007)
\item[] \textbf{M08}: MacCartney and Manning (2008)
  \begin{itemize}
    \item \textit{Classify} entailment after aligning premise and hypothesis.
  \end{itemize}
\item[] \darkblue{\textbf{N}: NaturalLI (this work)}
  \begin{itemize}
    \item \textit{Search} blindly from hypothesis for the premise.
  \end{itemize}
\end{itemize}
\pause

\begin{center}
  \begin{tabular}{llccc}
    \hline
    $\mathsection$ & Category & \multicolumn{3}{c}{Accuracy} \\
                   &          & M07 & M08 & \darkblue{N}  \\
    \hline
                          % Pme           P07   Rme          R08   Ame         A07  A08
    \a{1} & \a{Quantifiers}  & \a{84} & \a{97} & \a{\darkblue{95}}  \\
    \a{5} & \a{Adjectives}   & \a{60} & \a{80} & \a{\darkblue{73}}  \\
    \a{6} & \a{Comparatives} & \a{69} & \a{81} & \a{\darkblue{87}}  \pause \\
    \hline
    \multicolumn{2}{l}{\b{Applicable (1,5,6)}}
                         & \b{76} & \b{90} & \b{\darkblue{89}} \\
    \hline
  \end{tabular}
\end{center}
\end{frame}

%%%%%%%%%%%%%%%%%%%
% ConceptNet INTRO
%%%%%%%%%%%%%%%%%%%
\begin{frame}{Experiments}
\hh{ConceptNet:}
\begin{itemize}
  \item A semi-curated collection of common-sense facts. \\
    \vspace{0.1cm}
    \true{not all birds can fly} \\
    \true{noses are used to smell} \\
    \true{nobody wants to die} \\
    \true{music is used for pleasure}
    \vspace{0.1cm}
  \item Negatives: ReVerb extractions marked false by Turkers.
  \item Small (1378 train / 1080 test), but fairly broad coverage.
\end{itemize}
\vspace{0.5cm}
\pause

\hh{Our Knowledge Base:}
\begin{itemize}
  \item 270 million lemmatized Ollie extractions.
\end{itemize}
\end{frame}

%%%%%%%%%%%%%%%%%%%
% ConceptNet RESULTS
%%%%%%%%%%%%%%%%%%%
\begin{frame}{ConceptNet Results}
\hh{Systems}
\begin{itemize}
  \item[] \textbf{Direct Lookup}: Lookup by lemmas.
  \item[] \textbf{NaturalLI}: Our system.
  \pause
  \item[] \textbf{NaturalLI Only}: Use only inference (prohibit exact matches).
\end{itemize}
\pause

\begin{center}
  \begin{tabular}{lcc}
    System             & P     & R    \\
    \hline
    Direct Lookup      & 100.0 & \textbf<5-5>{12.1} \\
    \pause
    NaturalLI Only     & 88.8  & 40.1 \\
    NaturalLI          & 90.6  & \textbf<5-5>{49.1} \\
  \end{tabular}
\end{center}
\pause

\begin{itemize}
  \item 4x improvement in recall.
\end{itemize}
\end{frame}


This application makes use of the following third party libraries:

## Realm

TABLE OF CONTENTS

1. Apache License version 2.0
2. Realm Components
3. Export Compliance

-------------------------------------------------------------------------------

                                 Apache License
                           Version 2.0, January 2004
                        http://www.apache.org/licenses/

   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

   1. Definitions.

      "License" shall mean the terms and conditions for use, reproduction,
      and distribution as defined by Sections 1 through 9 of this document.

      "Licensor" shall mean the copyright owner or entity authorized by
      the copyright owner that is granting the License.

      "Legal Entity" shall mean the union of the acting entity and all
      other entities that control, are controlled by, or are under common
      control with that entity. For the purposes of this definition,
      "control" means (i) the power, direct or indirect, to cause the
      direction or management of such entity, whether by contract or
      otherwise, or (ii) ownership of fifty percent (50%) or more of the
      outstanding shares, or (iii) beneficial ownership of such entity.

      "You" (or "Your") shall mean an individual or Legal Entity
      exercising permissions granted by this License.

      "Source" form shall mean the preferred form for making modifications,
      including but not limited to software source code, documentation
      source, and configuration files.

      "Object" form shall mean any form resulting from mechanical
      transformation or translation of a Source form, including but
      not limited to compiled object code, generated documentation,
      and conversions to other media types.

      "Work" shall mean the work of authorship, whether in Source or
      Object form, made available under the License, as indicated by a
      copyright notice that is included in or attached to the work
      (an example is provided in the Appendix below).

      "Derivative Works" shall mean any work, whether in Source or Object
      form, that is based on (or derived from) the Work and for which the
      editorial revisions, annotations, elaborations, or other modifications
      represent, as a whole, an original work of authorship. For the purposes
      of this License, Derivative Works shall not include works that remain
      separable from, or merely link (or bind by name) to the interfaces of,
      the Work and Derivative Works thereof.

      "Contribution" shall mean any work of authorship, including
      the original version of the Work and any modifications or additions
      to that Work or Derivative Works thereof, that is intentionally
      submitted to Licensor for inclusion in the Work by the copyright owner
      or by an individual or Legal Entity authorized to submit on behalf of
      the copyright owner. For the purposes of this definition, "submitted"
      means any form of electronic, verbal, or written communication sent
      to the Licensor or its representatives, including but not limited to
      communication on electronic mailing lists, source code control systems,
      and issue tracking systems that are managed by, or on behalf of, the
      Licensor for the purpose of discussing and improving the Work, but
      excluding communication that is conspicuously marked or otherwise
      designated in writing by the copyright owner as "Not a Contribution."

      "Contributor" shall mean Licensor and any individual or Legal Entity
      on behalf of whom a Contribution has been received by Licensor and
      subsequently incorporated within the Work.

   2. Grant of Copyright License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      copyright license to reproduce, prepare Derivative Works of,
      publicly display, publicly perform, sublicense, and distribute the
      Work and such Derivative Works in Source or Object form.

   3. Grant of Patent License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      (except as stated in this section) patent license to make, have made,
      use, offer to sell, sell, import, and otherwise transfer the Work,
      where such license applies only to those patent claims licensable
      by such Contributor that are necessarily infringed by their
      Contribution(s) alone or by combination of their Contribution(s)
      with the Work to which such Contribution(s) was submitted. If You
      institute patent litigation against any entity (including a
      cross-claim or counterclaim in a lawsuit) alleging that the Work
      or a Contribution incorporated within the Work constitutes direct
      or contributory patent infringement, then any patent licenses
      granted to You under this License for that Work shall terminate
      as of the date such litigation is filed.

   4. Redistribution. You may reproduce and distribute copies of the
      Work or Derivative Works thereof in any medium, with or without
      modifications, and in Source or Object form, provided that You
      meet the following conditions:

      (a) You must give any other recipients of the Work or
          Derivative Works a copy of this License; and

      (b) You must cause any modified files to carry prominent notices
          stating that You changed the files; and

      (c) You must retain, in the Source form of any Derivative Works
          that You distribute, all copyright, patent, trademark, and
          attribution notices from the Source form of the Work,
          excluding those notices that do not pertain to any part of
          the Derivative Works; and

      (d) If the Work includes a "NOTICE" text file as part of its
          distribution, then any Derivative Works that You distribute must
          include a readable copy of the attribution notices contained
          within such NOTICE file, excluding those notices that do not
          pertain to any part of the Derivative Works, in at least one
          of the following places: within a NOTICE text file distributed
          as part of the Derivative Works; within the Source form or
          documentation, if provided along with the Derivative Works; or,
          within a display generated by the Derivative Works, if and
          wherever such third-party notices normally appear. The contents
          of the NOTICE file are for informational purposes only and
          do not modify the License. You may add Your own attribution
          notices within Derivative Works that You distribute, alongside
          or as an addendum to the NOTICE text from the Work, provided
          that such additional attribution notices cannot be construed
          as modifying the License.

      You may add Your own copyright statement to Your modifications and
      may provide additional or different license terms and conditions
      for use, reproduction, or distribution of Your modifications, or
      for any such Derivative Works as a whole, provided Your use,
      reproduction, and distribution of the Work otherwise complies with
      the conditions stated in this License.

   5. Submission of Contributions. Unless You explicitly state otherwise,
      any Contribution intentionally submitted for inclusion in the Work
      by You to the Licensor shall be under the terms and conditions of
      this License, without any additional terms or conditions.
      Notwithstanding the above, nothing herein shall supersede or modify
      the terms of any separate license agreement you may have executed
      with Licensor regarding such Contributions.

   6. Trademarks. This License does not grant permission to use the trade
      names, trademarks, service marks, or product names of the Licensor,
      except as required for reasonable and customary use in describing the
      origin of the Work and reproducing the content of the NOTICE file.

   7. Disclaimer of Warranty. Unless required by applicable law or
      agreed to in writing, Licensor provides the Work (and each
      Contributor provides its Contributions) on an "AS IS" BASIS,
      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
      implied, including, without limitation, any warranties or conditions
      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
      PARTICULAR PURPOSE. You are solely responsible for determining the
      appropriateness of using or redistributing the Work and assume any
      risks associated with Your exercise of permissions under this License.

   8. Limitation of Liability. In no event and under no legal theory,
      whether in tort (including negligence), contract, or otherwise,
      unless required by applicable law (such as deliberate and grossly
      negligent acts) or agreed to in writing, shall any Contributor be
      liable to You for damages, including any direct, indirect, special,
      incidental, or consequential damages of any character arising as a
      result of this License or out of the use or inability to use the
      Work (including but not limited to damages for loss of goodwill,
      work stoppage, computer failure or malfunction, or any and all
      other commercial damages or losses), even if such Contributor
      has been advised of the possibility of such damages.

   9. Accepting Warranty or Additional Liability. While redistributing
      the Work or Derivative Works thereof, You may choose to offer,
      and charge a fee for, acceptance of support, warranty, indemnity,
      or other liability obligations and/or rights consistent with this
      License. However, in accepting such obligations, You may act only
      on Your own behalf and on Your sole responsibility, not on behalf
      of any other Contributor, and only if You agree to indemnify,
      defend, and hold each Contributor harmless for any liability
      incurred by, or claims asserted against, such Contributor by reason
      of your accepting any such warranty or additional liability.

REALM COMPONENTS

This software contains components with separate copyright and license terms.
Your use of these components is subject to the terms and conditions of the
following licenses.

For the Realm Core component

  Realm Core Binary License

  Copyright (c) 2011-2016 Realm Inc All rights reserved

  Redistribution and use in binary form, with or without modification, is
  permitted provided that the following conditions are met:

  1. You agree not to attempt to decompile, disassemble, reverse engineer or
  otherwise discover the source code from which the binary code was derived.
  You may, however, access and obtain a separate license for most of the
  source code from which this Software was created, at
  http://realm.io/pricing/.

  2. Redistributions in binary form must reproduce the above copyright notice,
  this list of conditions and the following disclaimer in the documentation
  and/or other materials provided with the distribution.

  3. Neither the name of the copyright holder nor the names of its
  contributors may be used to endorse or promote products derived from this
  software without specific prior written permission.

  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  POSSIBILITY OF SUCH DAMAGE.

EXPORT COMPLIANCE

You understand that the Software may contain cryptographic functions that may be
subject to export restrictions, and you represent and warrant that you are not
(i) located in a jurisdiction that is subject to United States economic
sanctions (“Prohibited Jurisdiction”), including Cuba, Iran, North Korea,
Sudan, Syria or the Crimea region, (ii) a person listed on any U.S. government
blacklist (to include the List of Specially Designated Nationals and Blocked
Persons or the Consolidated Sanctions List administered by the U.S. Department
of the Treasury’s Office of Foreign Assets Control, or the Denied Persons List
or Entity List administered by the U.S. Department of Commerce)
(“Sanctioned Person”), or (iii) controlled or 50% or more owned by a Sanctioned
Person.

You agree to comply with all export, re-export and import restrictions and
regulations of the U.S. Department of Commerce or other agency or authority of
the United States or other applicable countries. You also agree not to transfer,
or authorize the transfer of, directly or indirectly, of the Software to any
Prohibited Jurisdiction, or otherwise in violation of any such restrictions or
regulations.

Generated by CocoaPods - http://cocoapods.org


class hsfcStatistic {

public:
	hsfcStatistic(void);
	~hsfcStatistic(void);

	void Initialise();
	void AddObservation(double Value);
	double Average();
	double StdDev();

	double Count;
	double Sum;
	double Sum2;

protected:

private:

};

//=============================================================================
// CLASS: hsfcLexicon
//=============================================================================
class hsfcLexicon {

public:
	hsfcLexicon(void);
	~hsfcLexicon(void);

	void Initialise(hsfcParameters* Parameters);
	unsigned int Index(const char* Value);
	unsigned int RelationIndex(const char* Value, bool Add);
	unsigned int RelationIndex(unsigned int NameID);
	unsigned int GDLIndex(unsigned int ID);
	unsigned int NewRigidNameID(int Arity);
	void Parse(const char* Text, vector<hsfcTuple>& Reference);
	bool Match(unsigned int ID, const char* Text);
	bool PartialMatch(unsigned int ID, const char* Text);
	bool MatchText(unsigned int ID, const char* Text);
	bool IsVariable(unsigned int ID);
	bool IsUsed(const char* Letter, bool IgnoreComments);
	const char* Text(unsigned int ID);
	char* Copy(unsigned int ID, bool WithArity);
	const char* Relation(unsigned int ID);
	unsigned int Size();
	unsigned int TrueFrom(unsigned int RelationIndex);
	unsigned int NextFrom(unsigned int RelationIndex);
	unsigned int InitFrom(unsigned int RelationIndex);
	void Print();

	hsfcIO* IO;

protected:

private:
	unsigned int AddTerm(const char* Value);
	unsigned int AddName(const char* Value);

	vector<string> Term;
	vector<unsigned int> TermIndex;
	vector<string> RelationName;
	vector<unsigned int> RelationNameID;
	vector<bool> RelationIsRigid;
	int UniqueNum;

};


/* vim: set ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
   http://creativecommons.org/publicdomain/zero/1.0/ */

let tempScope = {};
Cu.import("resource:///modules/devtools/CssRuleView.jsm", tempScope);
let CssRuleView = tempScope.CssRuleView;
let _ElementStyle = tempScope._ElementStyle;
let _editableField = tempScope._editableField;
let inplaceEditor = tempScope._getInplaceEditorForSpan;

let doc;
let ruleDialog;
let ruleView;

var gRuleViewChanged = false;
function ruleViewChanged()
{
  gRuleViewChanged = true;
}

function expectChange()
{
  ok(gRuleViewChanged, "Rule view should have fired a change event.");
  gRuleViewChanged = false;
}

function startTest()
{
  let style = '' +
    '#testid {' +
    '  background-color: blue;' +
    '} ' +
    '.testclass {' +
    '  background-color: green;' +
    '}';

  let styleNode = addStyle(doc, style);
  doc.body.innerHTML = '
Styled Node
';
  let testElement = doc.getElementById("testid");

  ruleDialog = openDialog("chrome://browser/content/devtools/cssruleview.xul",
                          "cssruleviewtest",
                          "width=200,height=350");
  ruleDialog.addEventListener("load", function onLoad(evt) {
    ruleDialog.removeEventListener("load", onLoad, true);
    let doc = ruleDialog.document;
    ruleView = new CssRuleView(doc);
    doc.documentElement.appendChild(ruleView.element);
    ruleView.element.addEventListener("CssRuleViewChanged", ruleViewChanged, false);
    ruleView.highlight(testElement);
    waitForFocus(testCancelNew, ruleDialog);
  }, true);
}

function testCancelNew()
{
  // Start at the beginning: start to add a rule to the element's style
  // declaration, but leave it empty.

  let elementRuleEditor = ruleView.element.children[0]._ruleEditor;
  waitForEditorFocus(elementRuleEditor.element, function onNewElement(aEditor) {
    is(inplaceEditor(elementRuleEditor.newPropSpan), aEditor, "Next focused editor should be the new property editor.");
    let input = aEditor.input;
    waitForEditorBlur(aEditor, function () {
      ok(!gRuleViewChanged, "Shouldn't get a change event after a cancel.");
      is(elementRuleEditor.rule.textProps.length,  0, "Should have canceled creating a new text property.");
      ok(!elementRuleEditor.propertyList.hasChildNodes(), "Should not have any properties.");
      testCreateNew();
    });
    aEditor.input.blur();
  });

  EventUtils.synthesizeMouse(elementRuleEditor.closeBrace, 1, 1,
                             { },
                             ruleDialog);
}

function testCreateNew()
{
  // Create a new property.
  let elementRuleEditor = ruleView.element.children[0]._ruleEditor;
  waitForEditorFocus(elementRuleEditor.element, function onNewElement(aEditor) {
    is(inplaceEditor(elementRuleEditor.newPropSpan), aEditor, "Next focused editor should be the new property editor.");
    let input = aEditor.input;
    input.value = "background-color";

    waitForEditorFocus(elementRuleEditor.element, function onNewValue(aEditor) {
      expectChange();
      is(elementRuleEditor.rule.textProps.length,  1, "Should have created a new text property.");
      is(elementRuleEditor.propertyList.children.length, 1, "Should have created a property editor.");
      let textProp = elementRuleEditor.rule.textProps[0];
      is(aEditor, inplaceEditor(textProp.editor.valueSpan), "Should be editing the value span now.");
      aEditor.input.value = "#XYZ";
      waitForEditorBlur(aEditor, function() {
        expectChange();
        is(textProp.value, "#XYZ", "Text prop should have been changed.");
        is(textProp.editor._validate(), false, "#XYZ should not be a valid entry");
        testEditProperty();
      });
      aEditor.input.blur();
    });
    EventUtils.synthesizeKey("VK_RETURN", {}, ruleDialog);
  });

  EventUtils.synthesizeMouse(elementRuleEditor.closeBrace, 1, 1,
                             { },
                             ruleDialog);
}

function testEditProperty()
{
  let idRuleEditor = ruleView.element.children[1]._ruleEditor;
  let propEditor = idRuleEditor.rule.textProps[0].editor;
  waitForEditorFocus(propEditor.element, function onNewElement(aEditor) {
    is(inplaceEditor(propEditor.nameSpan), aEditor, "Next focused editor should be the name editor.");
    let input = aEditor.input;
    waitForEditorFocus(propEditor.element, function onNewName(aEditor) {
      expectChange();
      input = aEditor.input;
      is(inplaceEditor(propEditor.valueSpan), aEditor, "Focus should have moved to the value.");

      waitForEditorBlur(aEditor, function() {
        expectChange();
        let value = idRuleEditor.rule.style.getPropertyValue("border-color");
        is(value, "red", "border-color should have been set.");
        is(propEditor._validate(), true, "red should be a valid entry");
        finishTest();
      });

      for each (let ch in "red;") {
        EventUtils.sendChar(ch, ruleDialog);
      }
    });
    for each (let ch in "border-color:") {
      EventUtils.sendChar(ch, ruleDialog);
    }
  });

  EventUtils.synthesizeMouse(propEditor.nameSpan, 1, 1,
                             { },
                             ruleDialog);}

function finishTest()
{
  ruleView.element.removeEventListener("CssRuleViewChanged", ruleViewChanged, false);
  ruleView.clear();
  ruleDialog.close();
  ruleDialog = ruleView = null;
  doc = null;
  gBrowser.removeCurrentTab();
  finish();
}

function test()
{
  waitForExplicitFinish();
  gBrowser.selectedTab = gBrowser.addTab();
  gBrowser.selectedBrowser.addEventListener("load", function changedValues_load(evt) {
    gBrowser.selectedBrowser.removeEventListener(evt.type, changedValues_load, true);
    doc = content.document;
    waitForFocus(startTest, content);
  }, true);

  content.location = "data:text/html,test rule view user changes";
}


<!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">

    	<title>FST - Gabe Kling</title>

        <meta name="description" content="Keep track of the statistics from Gabe Kling. Average heat score, heat wins, heat wins percentage, epic heats road to the final">

    <meta name="author" content="">
    <link rel="apple-touch-icon" sizes="57x57" href="/favicon/apple-icon-57x57.png">
    <link rel="apple-touch-icon" sizes="60x60" href="/favicon/apple-icon-60x60.png">
    <link rel="apple-touch-icon" sizes="72x72" href="/favicon/apple-icon-72x72.png">
    <link rel="apple-touch-icon" sizes="76x76" href="/favicon/apple-icon-76x76.png">
    <link rel="apple-touch-icon" sizes="114x114" href="/favicon/apple-icon-114x114.png">
    <link rel="apple-touch-icon" sizes="120x120" href="/favicon/apple-icon-120x120.png">
    <link rel="apple-touch-icon" sizes="144x144" href="/favicon/apple-icon-144x144.png">
    <link rel="apple-touch-icon" sizes="152x152" href="/favicon/apple-icon-152x152.png">
    <link rel="apple-touch-icon" sizes="180x180" href="/favicon/apple-icon-180x180.png">
    <link rel="icon" type="image/png" sizes="192x192"  href="/favicon/android-icon-192x192.png">
    <link rel="icon" type="image/png" sizes="32x32" href="/favicon/favicon-32x32.png">
    <link rel="icon" type="image/png" sizes="96x96" href="/favicon/favicon-96x96.png">
    <link rel="icon" type="image/png" sizes="16x16" href="/favicon/favicon-16x16.png">

    <link rel="manifest" href="/manifest.json">
    <meta name="msapplication-TileColor" content="#ffffff">
    <meta name="msapplication-TileImage" content="/ms-icon-144x144.png">
    <meta name="theme-color" content="#ffffff">

    <meta property="og:title" content="Fantasy Surfing tips"/>
    <meta property="og:image" content="https://fantasysurfingtips.com/img/just_waves.png"/>
    	    <meta property="og:description" content="See how great Gabe Kling is surfing this year"/>

    <link href="https://fantasysurfingtips.com/css/bootstrap.css" rel="stylesheet">

    <link href="https://fantasysurfingtips.com/css/freelancer.css" rel="stylesheet">
    <link href="https://cdn.datatables.net/plug-ins/1.10.7/integration/bootstrap/3/dataTables.bootstrap.css" rel="stylesheet" />

    <link href="https://fantasysurfingtips.com/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <link href="https://fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet" type="text/css">
    <link href="https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic" rel="stylesheet" type="text/css">

 	<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/morris.js/0.5.1/morris.css">

Gabe Kling

	                 Share on Twitter

					 Share on Facebook

Avg Heat Score (FST DATA)

12.0

Epic Battles

Surfed 1 heats against  Kevin Schulz
 won 1 and lost 0

Surfed 4 heats against  Elijah Gates
 won 0 and lost 4

Heat Stats (FST data)

Heats

52

Heat wins

3

HEAT WINS PERCENTAGE

5.77%

Avg Heat Score progression

Heat stats progression

		Please enable JavaScript to view the comments powered by Disqus.


package org.ovirt.mobile.movirt.rest.dto.v4;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

import org.ovirt.mobile.movirt.model.enums.SnapshotType;

@JsonIgnoreProperties(ignoreUnknown = true)
public class Snapshot extends org.ovirt.mobile.movirt.rest.dto.Snapshot {
    public SnapshotVm vm;
    public String snapshot_type;

    public Snapshot() {
    }

    public Snapshot(String description, boolean persistMemoryState) {
        super(description, persistMemoryState);
    }

    public org.ovirt.mobile.movirt.model.Snapshot toEntity(String accountId) {
        org.ovirt.mobile.movirt.model.Snapshot snapshot = super.toEntity(accountId);
        snapshot.setType(SnapshotType.fromString(snapshot_type));

        if (vm != null) {
            vm.snapshotId = snapshot.getId();
            snapshot.setVm(vm.toEntity(accountId));
        }

        return snapshot;
    }
}