text:
<?php
include "../Log_in_out/core.php";
if (logged_in()) {
    ?>
    <!DOCTYPE html>

        <title>Enter Term Marks</title>
        <link rel="stylesheet" type = "text/css" href = "../Styles/stylesheets.css"/>
        <?php
        include '../Styles/FormStyle.html';
        ?>

 Home

 Profile

 Marks

 Attendance

 Logout

Enter Subject, Grade, Division, Year and Term

            <form action="../TermMarks/EnterMarks.php" method="post" name="fixedform">
                <fieldset>
                    Subject:

                    <select name = 'subject'>
                        <option value = 'Religion_Hindu'>Religion-Hindu</option>
                        <option value = 'Religion_RC'>Religion-RC</option>
                        <option value = 'Tamil'>Tamil</option>
                        <option value = 'Mathematics'>Mathematics</option>
                        <option value = 'Social'>Social</option>
                        <option value = 'English'>English</option>
                    </select>

                    Grade:

                    <select name = 'grade'>
                        <option value = '1'>1</option>
                        <option value = '2'>2</option>
                        <option value = '3'>3</option>
                        <option value = '4'>4</option>
                        <option value = '5'>5</option>
                    </select>

                    Division:

                    <select name = 'division'>
                        <option value = 'A'>A</option>
                        <option value = 'B'>B</option>
                        <option value = 'C'>C</option>
                        <option value = 'D'>D</option>
                        <option value = 'E'>E</option>
                        <option value = 'F'>F</option>
                    </select>

                    Year:

                    <input type="text" name="year">

                    Term:

                    <select name = 'term'>
                        <option value = 1>I</option>
                        <option value = 2>II</option>
                        <option value = 3>III</option>
                    </select>

                    <input type="submit" value="Submit">
                </fieldset>

            </form>

        <?php
        include '../Styles/SidebarStyle.html';
        include '../Styles/FooterStyle.html';
        ?>

    <?php
} else {
    include '../Log_in_out/loginform.php';
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <types>
        <members>*</members>
        <name>ApexClass</name>
    </types>
    <types>
        <members>*</members>
        <name>ApexTrigger</name>
    </types>
    <types>
        <members>*</members>
        <name>CustomObject</name>
    </types>
    <types>
        <members>*</members>
        <name>CustomTab</name>
    </types>
    <types>
        <members>Mobile_Device__c-Mobile Device Layout</members>
        <name>Layout</name>
    </types>
    <types>
        <members>UrbanAirship</members>
        <name>RemoteSiteSetting</name>
    </types>
    <version>23.0</version>
</Package>

redpajama_set_name: RedPajamaGithub


text:
"""SCons.Subst

SCons string substitution.

"""

#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#

__revision__ = "src/engine/SCons/Subst.py 2446 2007/09/18 11:41:57 knight"

import SCons.compat

import re
import string
import types
import UserList
import UserString

import SCons.Errors

from SCons.Util import is_String, is_List, is_Tuple

# Indexed by the SUBST_* constants below.
_strconv = [SCons.Util.to_String,
            SCons.Util.to_String,
            SCons.Util.to_String_for_signature]

AllowableExceptions = (IndexError, NameError)

def SetAllowableExceptions(*excepts):
    global AllowableExceptions
    AllowableExceptions = filter(None, excepts)

def raise_exception(exception, target, s):
    name = exception.__class__.__name__
    msg = "%s `%s' trying to evaluate `%s'" % (name, exception, s)
    if target:
        raise SCons.Errors.BuildError, (target[0], msg)
    else:
        raise SCons.Errors.UserError, msg

class Literal:
    """A wrapper for a string.  If you use this object wrapped
    around a string, then it will be interpreted as literal.
    When passed to the command interpreter, all special
    characters will be escaped."""
    def __init__(self, lstr):
        self.lstr = lstr

    def __str__(self):
        return self.lstr

    def escape(self, escape_func):
        return escape_func(self.lstr)

    def for_signature(self):
        return self.lstr

    def is_literal(self):
        return 1

class SpecialAttrWrapper:
    """This is a wrapper for what we call a 'Node special attribute.'
    This is any of the attributes of a Node that we can reference from
    Environment variable substitution, such as $TARGET.abspath or
    $SOURCES[1].filebase.  We implement the same methods as Literal
    so we can handle special characters, plus a for_signature method,
    such that we can return some canonical string during signature
    calculation to avoid unnecessary rebuilds."""

    def __init__(self, lstr, for_signature=None):
        """The for_signature parameter, if supplied, will be the
        canonical string we return from for_signature().  Else
        we will simply return lstr."""
        self.lstr = lstr
        if for_signature:
            self.forsig = for_signature
        else:
            self.forsig = lstr

    def __str__(self):
        return self.lstr

    def escape(self, escape_func):
        return escape_func(self.lstr)

    def for_signature(self):
        return self.forsig

    def is_literal(self):
        return 1

def quote_spaces(arg):
    """Generic function for putting double quotes around any string that
    has white space in it."""
    if ' ' in arg or '\t' in arg:
        return '"%s"' % arg
    else:
        return str(arg)

class CmdStringHolder(UserString.UserString):
    """This is a special class used to hold strings generated by
    scons_subst() and scons_subst_list().  It defines a special method
    escape().  When passed a function with an escape algorithm for a
    particular platform, it will return the contained string with the
    proper escape sequences inserted.
    """
    def __init__(self, cmd, literal=None):
        UserString.UserString.__init__(self, cmd)
        self.literal = literal

    def is_literal(self):
        return self.literal

    def escape(self, escape_func, quote_func=quote_spaces):
        """Escape the string with the supplied function.  The
        function is expected to take an arbitrary string, then
        return it with all special characters escaped and ready
        for passing to the command interpreter.

        After calling this function, the next call to str() will
        return the escaped string.
        """

        if self.is_literal():
            return escape_func(self.data)
        elif ' ' in self.data or '\t' in self.data:
            return quote_func(self.data)
        else:
            return self.data

def escape_list(list, escape_func):
    """Escape a list of arguments by running the specified escape_func
    on every object in the list that has an escape() method."""
    def escape(obj, escape_func=escape_func):
        try:
            e = obj.escape
        except AttributeError:
            return obj
        else:
            return e(escape_func)
    return map(escape, list)

class NLWrapper:
    """A wrapper class that delays turning a list of sources or targets
    into a NodeList until it's needed.  The specified function supplied
    when the object is initialized is responsible for turning raw nodes
    into proxies that implement the special attributes like .abspath,
    .source, etc.  This way, we avoid creating those proxies just
    "in case" someone is going to use $TARGET or the like, and only
    go through the trouble if we really have to.

    In practice, this might be a wash performance-wise, but it's a little
    cleaner conceptually...
    """

    def __init__(self, list, func):
        self.list = list
        self.func = func
    def _return_nodelist(self):
        return self.nodelist
    def _gen_nodelist(self):
        list = self.list
        if list is None:
            list = []
        elif not is_List(list) and not is_Tuple(list):
            list = [list]
        # The map(self.func) call is what actually turns
        # a list into appropriate proxies.
        self.nodelist = SCons.Util.NodeList(map(self.func, list))
        self._create_nodelist = self._return_nodelist
        return self.nodelist
    _create_nodelist = _gen_nodelist

class Targets_or_Sources(UserList.UserList):
    """A class that implements $TARGETS or $SOURCES expansions by in turn
    wrapping a NLWrapper.  This class handles the different methods used
    to access the list, calling the NLWrapper to create proxies on demand.

    Note that we subclass UserList.UserList purely so that the is_List()
    function will identify an object of this class as a list during
    variable expansion.  We're not really using any UserList.UserList
    methods in practice.
    """
    def __init__(self, nl):
        self.nl = nl
    def __getattr__(self, attr):
        nl = self.nl._create_nodelist()
        return getattr(nl, attr)
    def __getitem__(self, i):
        nl = self.nl._create_nodelist()
        return nl[i]
    def __getslice__(self, i, j):
        nl = self.nl._create_nodelist()
        i = max(i, 0); j = max(j, 0)
        return nl[i:j]
    def __str__(self):
        nl = self.nl._create_nodelist()
        return str(nl)
    def __repr__(self):
        nl = self.nl._create_nodelist()
        return repr(nl)

class Target_or_Source:
    """A class that implements $TARGET or $SOURCE expansions by in turn
    wrapping a NLWrapper.  This class handles the different methods used
    to access an individual proxy Node, calling the NLWrapper to create
    a proxy on demand.
    """
    def __init__(self, nl):
        self.nl = nl
    def __getattr__(self, attr):
        nl = self.nl._create_nodelist()
        try:
            nl0 = nl[0]
        except IndexError:
            # If there is nothing in the list, then we have no attributes to
            # pass through, so raise AttributeError for everything.
            raise AttributeError, "NodeList has no attribute: %s" % attr
        return getattr(nl0, attr)
    def __str__(self):
        nl = self.nl._create_nodelist()
        if nl:
            return str(nl[0])
        return ''
    def __repr__(self):
        nl = self.nl._create_nodelist()
        if nl:
            return repr(nl[0])
        return ''

def subst_dict(target, source):
    """Create a dictionary for substitution of special
    construction variables.

    This translates the following special arguments:

    target - the target (object or array of objects),
             used to generate the TARGET and TARGETS
             construction variables

    source - the source (object or array of objects),
             used to generate the SOURCES and SOURCE
             construction variables
    """
    dict = {}

    if target:
        tnl = NLWrapper(target, lambda x: x.get_subst_proxy())
        dict['TARGETS'] = Targets_or_Sources(tnl)
        dict['TARGET'] = Target_or_Source(tnl)
    else:
        dict['TARGETS'] = None
        dict['TARGET'] = None

    if source:
        def get_src_subst_proxy(node):
            try:
                rfile = node.rfile
            except AttributeError:
                pass
            else:
                node = rfile()
            return node.get_subst_proxy()
        snl = NLWrapper(source, get_src_subst_proxy)
        dict['SOURCES'] = Targets_or_Sources(snl)
        dict['SOURCE'] = Target_or_Source(snl)
    else:
        dict['SOURCES'] = None
        dict['SOURCE'] = None

    return dict

# Constants for the "mode" parameter to scons_subst_list() and
# scons_subst().  SUBST_RAW gives the raw command line.  SUBST_CMD
# gives a command line suitable for passing to a shell.  SUBST_SIG
# gives a command line appropriate for calculating the signature
# of a command line...if this changes, we should rebuild.
SUBST_CMD = 0
SUBST_RAW = 1
SUBST_SIG = 2

_rm = re.compile(r'\$[()]')
_remove = re.compile(r'\$\([^\$]*(\$[^\)][^\$]*)*\$\)')

# Indexed by the SUBST_* constants above.
_regex_remove = [ _rm, None, _remove ]

# Regular expressions for splitting strings and handling substitutions,
# for use by the scons_subst() and scons_subst_list() functions:
#
# The first expression compiled matches all of the $-introduced tokens
# that we need to process in some way, and is used for substitutions.
# The expressions it matches are:
#
#       "$$"
#       "$("
#       "$)"
#       "$variable"             [must begin with alphabetic or underscore]
#       "${any stuff}"
#
# The second expression compiled is used for splitting strings into tokens
# to be processed, and it matches all of the tokens listed above, plus
# the following that affect how arguments do or don't get joined together:
#
#       "   "                   [white space]
#       "non-white-space"       [without any dollar signs]
#       "$"                     [single dollar sign]
#
_dollar_exps_str = r'\$[\$\(\)]|\$[_a-zA-Z][\.\w]*|\${[^}]*}'
_dollar_exps = re.compile(r'(%s)' % _dollar_exps_str)
_separate_args = re.compile(r'(%s|\s+|[^\s\$]+|\$)' % _dollar_exps_str)

# This regular expression is used to replace strings of multiple white
# space characters in the string result from the scons_subst() function.
_space_sep = re.compile(r'[\t ]+(?![^{]*})')

def scons_subst(strSubst, env, mode=SUBST_RAW, target=None, source=None, gvars={}, lvars={}, conv=None):
    """Expand a string containing construction variable substitutions.

    This is the work-horse function for substitutions in file names
    and the like.  The companion scons_subst_list() function (below)
    handles separating command lines into lists of arguments, so see
    that function if that's what you're looking for.
    """
    if type(strSubst) == types.StringType and string.find(strSubst, '$') < 0:
        return strSubst

    class StringSubber:
        """A class to construct the results of a scons_subst() call.

        This binds a specific construction environment, mode, target and
        source with two methods (substitute() and expand()) that handle
        the expansion.
        """
        def __init__(self, env, mode, target, source, conv, gvars):
            self.env = env
            self.mode = mode
            self.target = target
            self.source = source
            self.conv = conv
            self.gvars = gvars

        def expand(self, s, lvars):
            """Expand a single "token" as necessary, returning an
            appropriate string containing the expansion.

            This handles expanding different types of things (strings,
            lists, callables) appropriately.  It calls the wrapper
            substitute() method to re-expand things as necessary, so that
            the results of expansions of side-by-side strings still get
            re-evaluated separately, not smushed together.
            """
            if is_String(s):
                try:
                    s0, s1 = s[:2]
                except (IndexError, ValueError):
                    return s
                if s0 != '$':
                    return s
                if s1 == '$':
                    return '$'
                elif s1 in '()':
                    return s
                else:
                    key = s[1:]
                    if key[0] == '{' or string.find(key, '.') >= 0:
                        if key[0] == '{':
                            key = key[1:-1]
                        try:
                            s = eval(key, self.gvars, lvars)
                        except KeyboardInterrupt:
                            raise
                        except Exception, e:
                            if e.__class__ in AllowableExceptions:
                                return ''
                            raise_exception(e, self.target, s)
                    else:
                        if lvars.has_key(key):
                            s = lvars[key]
                        elif self.gvars.has_key(key):
                            s = self.gvars[key]
                        elif not NameError in AllowableExceptions:
                            raise_exception(NameError(key), self.target, s)
                        else:
                            return ''

                    # Before re-expanding the result, handle
                    # recursive expansion by copying the local
                    # variable dictionary and overwriting a null
                    # string for the value of the variable name
                    # we just expanded.
                    #
                    # This could potentially be optimized by only
                    # copying lvars when s contains more expansions,
                    # but lvars is usually supposed to be pretty
                    # small, and deeply nested variable expansions
                    # are probably more the exception than the norm,
                    # so it should be tolerable for now.
                    lv = lvars.copy()
                    var = string.split(key, '.')[0]
                    lv[var] = ''
                    return self.substitute(s, lv)
            elif is_List(s) or is_Tuple(s):
                def func(l, conv=self.conv, substitute=self.substitute, lvars=lvars):
                    return conv(substitute(l, lvars))
                r = map(func, s)
                return string.join(r)
            elif callable(s):
                try:
                    s = s(target=self.target,
                         source=self.source,
                         env=self.env,
                         for_signature=(self.mode != SUBST_CMD))
                except TypeError:
                    # This probably indicates that it's a callable
                    # object that doesn't match our calling arguments
                    # (like an Action).
                    if self.mode == SUBST_RAW:
                        return s
                    s = self.conv(s)
                return self.substitute(s, lvars)
            elif s is None:
                return ''
            else:
                return s

        def substitute(self, args, lvars):
            """Substitute expansions in an argument or list of arguments.

            This serves as a wrapper for splitting up a string into
            separate tokens.
            """
            if is_String(args) and not isinstance(args, CmdStringHolder):
                try:
                    def sub_match(match, conv=self.conv, expand=self.expand, lvars=lvars):
                        return conv(expand(match.group(1), lvars))
                    result = _dollar_exps.sub(sub_match, args)
                except TypeError:
                    # If the internal conversion routine doesn't return
                    # strings (it could be overridden to return Nodes, for
                    # example), then the 1.5.2 re module will throw this
                    # exception.  Back off to a slower, general-purpose
                    # algorithm that works for all data types.
                    args = _separate_args.findall(args)
                    result = []
                    for a in args:
                        result.append(self.conv(self.expand(a, lvars)))
                    try:
                        result = string.join(result, '')
                    except TypeError:
                        if len(result) == 1:
                            result = result[0]
                return result
            else:
                return self.expand(args, lvars)

    if conv is None:
        conv = _strconv[mode]

    # Doing this every time is a bit of a waste, since the Executor
    # has typically already populated the OverrideEnvironment with
    # $TARGET/$SOURCE variables.  We're keeping this (for now), though,
    # because it supports existing behavior that allows us to call
    # an Action directly with an arbitrary target+source pair, which
    # we use in Tool/tex.py to handle calling $BIBTEX when necessary.
    # If we dropped that behavior (or found another way to cover it),
    # we could get rid of this call completely and just rely on the
    # Executor setting the variables.
    d = subst_dict(target, source)
    if d:
        lvars = lvars.copy()
        lvars.update(d)

    # We're (most likely) going to eval() things.  If Python doesn't
    # find a __builtins__ value in the global dictionary used for eval(),
    # it copies the current global values for you.  Avoid this by
    # setting it explicitly and then deleting, so we don't pollute the
    # construction environment Dictionary(ies) that are typically used
    # for expansion.
    gvars['__builtins__'] = __builtins__

    ss = StringSubber(env, mode, target, source, conv, gvars)
    result = ss.substitute(strSubst, lvars)

    try:
        del gvars['__builtins__']
    except KeyError:
        pass

    if is_String(result):
        # Remove $(-$) pairs and any stuff in between,
        # if that's appropriate.
        remove = _regex_remove[mode]
        if remove:
            result = remove.sub('', result)
        if mode != SUBST_RAW:
            # Compress strings of white space characters into
            # a single space.
            result = string.strip(_space_sep.sub(' ', result))

    return result

#Subst_List_Strings = {}

def scons_subst_list(strSubst, env, mode=SUBST_RAW, target=None, source=None, gvars={}, lvars={}, conv=None):
    """Substitute construction variables in a string (or list or other
    object) and separate the arguments into a command list.

    The companion scons_subst() function (above) handles basic
    substitutions within strings, so see that function instead
    if that's what you're looking for.
    """
#    try:
#        Subst_List_Strings[strSubst] = Subst_List_Strings[strSubst] + 1
#    except KeyError:
#        Subst_List_Strings[strSubst] = 1
#    import SCons.Debug
#    SCons.Debug.caller(1)
    class ListSubber(UserList.UserList):
        """A class to construct the results of a scons_subst_list() call.

        Like StringSubber, this class binds a specific construction
        environment, mode, target and source with two methods
        (substitute() and expand()) that handle the expansion.

        In addition, however, this class is used to track the state of
        the result(s) we're gathering so we can do the appropriate thing
        whenever we have to append another word to the result--start a new
        line, start a new word, append to the current word, etc.  We do
        this by setting the "append" attribute to the right method so
        that our wrapper methods only need ever call ListSubber.append(),
        and the rest of the object takes care of doing the right thing
        internally.
        """
        def __init__(self, env, mode, target, source, conv, gvars):
            UserList.UserList.__init__(self, [])
            self.env = env
            self.mode = mode
            self.target = target
            self.source = source
            self.conv = conv
            self.gvars = gvars

            if self.mode == SUBST_RAW:
                self.add_strip = lambda x, s=self: s.append(x)
            else:
                self.add_strip = lambda x, s=self: None
            self.in_strip = None
            self.next_line()

        def expand(self, s, lvars, within_list):
            """Expand a single "token" as necessary, appending the
            expansion to the current result.

            This handles expanding different types of things (strings,
            lists, callables) appropriately.  It calls the wrapper
            substitute() method to re-expand things as necessary, so that
            the results of expansions of side-by-side strings still get
            re-evaluated separately, not smushed together.
            """

            if is_String(s):
                try:
                    s0, s1 = s[:2]
                except (IndexError, ValueError):
                    self.append(s)
                    return
                if s0 != '$':
                    self.append(s)
                    return
                if s1 == '$':
                    self.append('$')
                elif s1 == '(':
                    self.open_strip('$(')
                elif s1 == ')':
                    self.close_strip('$)')
                else:
                    key = s[1:]
                    if key[0] == '{' or string.find(key, '.') >= 0:
                        if key[0] == '{':
                            key = key[1:-1]
                        try:
                            s = eval(key, self.gvars, lvars)
                        except KeyboardInterrupt:
                            raise
                        except Exception, e:
                            if e.__class__ in AllowableExceptions:
                                return
                            raise_exception(e, self.target, s)
                    else:
                        if lvars.has_key(key):
                            s = lvars[key]
                        elif self.gvars.has_key(key):
                            s = self.gvars[key]
                        elif not NameError in AllowableExceptions:
                            raise_exception(NameError(), self.target, s)
                        else:
                            return

                    # Before re-expanding the result, handle
                    # recursive expansion by copying the local
                    # variable dictionary and overwriting a null
                    # string for the value of the variable name
                    # we just expanded.
                    lv = lvars.copy()
                    var = string.split(key, '.')[0]
                    lv[var] = ''
                    self.substitute(s, lv, 0)
                    self.this_word()
            elif is_List(s) or is_Tuple(s):
                for a in s:
                    self.substitute(a, lvars, 1)
                    self.next_word()
            elif callable(s):
                try:
                    s = s(target=self.target,
                         source=self.source,
                         env=self.env,
                         for_signature=(self.mode != SUBST_CMD))
                except TypeError:
                    # This probably indicates that it's a callable
                    # object that doesn't match our calling arguments
                    # (like an Action).
                    if self.mode == SUBST_RAW:
                        self.append(s)
                        return
                    s = self.conv(s)
                self.substitute(s, lvars, within_list)
            elif s is None:
                self.this_word()
            else:
                self.append(s)

        def substitute(self, args, lvars, within_list):
            """Substitute expansions in an argument or list of arguments.

            This serves as a wrapper for splitting up a string into
            separate tokens.
            """

            if is_String(args) and not isinstance(args, CmdStringHolder):
                args = _separate_args.findall(args)
                for a in args:
                    if a[0] in ' \t\n\r\f\v':
                        if '\n' in a:
                            self.next_line()
                        elif within_list:
                            self.append(a)
                        else:
                            self.next_word()
                    else:
                        self.expand(a, lvars, within_list)
            else:
                self.expand(args, lvars, within_list)

        def next_line(self):
            """Arrange for the next word to start a new line.  This
            is like starting a new word, except that we have to append
            another line to the result."""
            UserList.UserList.append(self, [])
            self.next_word()

        def this_word(self):
            """Arrange for the next word to append to the end of the
            current last word in the result."""
            self.append = self.add_to_current_word

        def next_word(self):
            """Arrange for the next word to start a new word."""
            self.append = self.add_new_word

        def add_to_current_word(self, x):
            """Append the string x to the end of the current last word
            in the result.  If that is not possible, then just add
            it as a new word.  Make sure the entire concatenated string
            inherits the object attributes of x (in particular, the
            escape function) by wrapping it as CmdStringHolder."""

            if not self.in_strip or self.mode != SUBST_SIG:
                try:
                    current_word = self[-1][-1]
                except IndexError:
                    self.add_new_word(x)
                else:
                    # All right, this is a hack and it should probably
                    # be refactored out of existence in the future.
                    # The issue is that we want to smoosh words together
                    # and make one file name that gets escaped if
                    # we're expanding something like foo$EXTENSION,
                    # but we don't want to smoosh them together if
                    # it's something like >$TARGET, because then we'll
                    # treat the '>' like it's part of the file name.
                    # So for now, just hard-code looking for the special
                    # command-line redirection characters...
                    try:
                        last_char = str(current_word)[-1]
                    except IndexError:
                        last_char = '\0'
                    if last_char in '<>|':
                        self.add_new_word(x)
                    else:
                        y = current_word + x

                        # We used to treat a word appended to a literal
                        # as a literal itself, but this caused problems
                        # with interpreting quotes around space-separated
                        # targets on command lines.  Removing this makes
                        # none of the "substantive" end-to-end tests fail,
                        # so we'll take this out but leave it commented
                        # for now in case there's a problem not covered
                        # by the test cases and we need to resurrect this.
                        #literal1 = self.literal(self[-1][-1])
                        #literal2 = self.literal(x)
                        y = self.conv(y)
                        if is_String(y):
                            #y = CmdStringHolder(y, literal1 or literal2)
                            y = CmdStringHolder(y, None)
                        self[-1][-1] = y

        def add_new_word(self, x):
            if not self.in_strip or self.mode != SUBST_SIG:
                literal = self.literal(x)
                x = self.conv(x)
                if is_String(x):
                    x = CmdStringHolder(x, literal)
                self[-1].append(x)
            self.append = self.add_to_current_word

        def literal(self, x):
            try:
                l = x.is_literal
            except AttributeError:
                return None
            else:
                return l()

        def open_strip(self, x):
            """Handle the "open strip" $( token."""
            self.add_strip(x)
            self.in_strip = 1

        def close_strip(self, x):
            """Handle the "close strip" $) token."""
            self.add_strip(x)
            self.in_strip = None

    if conv is None:
        conv = _strconv[mode]

    # Doing this every time is a bit of a waste, since the Executor
    # has typically already populated the OverrideEnvironment with
    # $TARGET/$SOURCE variables.  We're keeping this (for now), though,
    # because it supports existing behavior that allows us to call
    # an Action directly with an arbitrary target+source pair, which
    # we use in Tool/tex.py to handle calling $BIBTEX when necessary.
    # If we dropped that behavior (or found another way to cover it),
    # we could get rid of this call completely and just rely on the
    # Executor setting the variables.
    d = subst_dict(target, source)
    if d:
        lvars = lvars.copy()
        lvars.update(d)

    # We're (most likely) going to eval() things.  If Python doesn't
    # find a __builtins__ value in the global dictionary used for eval(),
    # it copies the current global values for you.  Avoid this by
    # setting it explicitly and then deleting, so we don't pollute the
    # construction environment Dictionary(ies) that are typically used
    # for expansion.
    gvars['__builtins__'] = __builtins__

    ls = ListSubber(env, mode, target, source, conv, gvars)
    ls.substitute(strSubst, lvars, 0)

    try:
        del gvars['__builtins__']
    except KeyError:
        pass

    return ls.data

def scons_subst_once(strSubst, env, key):
    """Perform single (non-recursive) substitution of a single
    construction variable keyword.

    This is used when setting a variable when copying or overriding values
    in an Environment.  We want to capture (expand) the old value before
    we override it, so people can do things like:

        env2 = env.Clone(CCFLAGS = '$CCFLAGS -g')

    We do this with some straightforward, brute-force code here...
    """
    if type(strSubst) == types.StringType and string.find(strSubst, '$') < 0:
        return strSubst

    matchlist = ['$' + key, '${' + key + '}']
    val = env.get(key, '')
    def sub_match(match, val=val, matchlist=matchlist):
        a = match.group(1)
        if a in matchlist:
            a = val
        if is_List(a) or is_Tuple(a):
            return string.join(map(str, a))
        else:
            return str(a)

    if is_List(strSubst) or is_Tuple(strSubst):
        result = []
        for arg in strSubst:
            if is_String(arg):
                if arg in matchlist:
                    arg = val
                    if is_List(arg) or is_Tuple(arg):
                        result.extend(arg)
                    else:
                        result.append(arg)
                else:
                    result.append(_dollar_exps.sub(sub_match, arg))
            else:
                result.append(arg)
        return result
    elif is_String(strSubst):
        return _dollar_exps.sub(sub_match, strSubst)
    else:
        return strSubst


text:
"use strict";

document.write(require("html-loader!./index.html"));

var input = document.getElementById("input");
var select = document.getElementById("select");
var open = document.getElementById("open");
var close = document.getElementById("close");
var getOption = document.getElementById("getOption");

if (window.document.createEvent) { // All
    var evt = window.document.createEvent("MouseEvents");
    evt.initMouseEvent("mousedown", false, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
    select.dispatchEvent(evt);
  } else if (el.fireEvent) { // IE
    select.fireEvent("onmousedown");
  }

input.addEventListener("click", function () {
    /*console.log(select);
    select.focus();
    select.click();

    var event = document.createEvent('MouseEvents');
    event.initMouseEvent('mouseup', true, true, window);
    select.dispatchEvent(event);

    select.setAttribute("size", select.children.length);
    select.focus();*/
});

select.addEventListener("click", function (event) {
    //event.preventDefault();
    console.log("select click");
});
select.addEventListener("mousedown", function (event) {
    //event.preventDefault();
    console.log("select mousedown");
});

open.addEventListener("mousedown", function (event) {
    select.style.display = "block";
    console.log(select.children)
    select.setAttribute("size", howManyOptions(select));
    // select.setAttribute("size", select.children.length);
    setTimeout(function () {
        select.focus();
    }, 0);

});
close.addEventListener("mousedown", function (event) {
    //event.preventDefault();
    select.style.display = "none";
    select.setAttribute("size", 1);
    //select.focus();
});

getOption.addEventListener("mousedown", function (event) {
    console.log(select.options[ select.selectedIndex ].getAttribute("data-group"));
});

function howManyOptions (select) {

    var howMany = 0;

    for (var i = 0; i < select.children.length; i ++) {

        if (select.children[i].tagName === "OPTGROUP") {
            howMany += select.children[i].children.length + 1; // plus the group lable itself

        } else if (select.children[i].tagName === "OPTION") {
            howMany += select.children[i].length;
        }

    }

    return howMany;

}

function walkTheDom (container, element) {
    var node = container.firstChild;

    while (node) {

        node = node.nextSibling;
        if (node && node.tagName && node.tagName !== "OPTION" && node.tagName !== "OPTGROUP") {
            walkTheDom(node, element);

            if (node.tagName === element) {
                console.log(node.tagName, element);
            }

        }

    }

}

walkTheDom(document.body, "INPUT");


text:
author:
  display_name: Data Queen
  email: ugrc@utah.gov
tags:
  - address
  - centerline
  - data
  - geocoding
  - location
  - roads
date: 2014-07-03 13:37:47 -0600
title: Utah SGID Statewide Roads Data Layer Updates 7/3/2014
published: false
categories:
  - Featured
  - SGID Blog
---
Updates were made recently to the SGID10.Transportation.Roads feature class that resides on the Utah SGID ArcSDE database server.

Geocoding services and ArcGIS Server Applications & Web Services are now using the updated SGID10.Transportation.Roads feature class.

The following highlights what has been updated:

County Updates:

- **Davis:** Received centerline update 7/1/2014: added new roads, road name and address range changes since 6/3/2014; geocoding improvements
- **Juab:** Received centerline update 6/23/2014: added new roads, road names, and address ranges; geocoding improvements
- **Morgan:** Received centerline update 6/24/2014: added new roads; geocoding improvements
- **Rich:** Received centerline update 6/17/2014: added new roads, road names, and address ranges; geocoding improvements
- **Salt Lake:** Received VECC's centerline update 7/1/2014: added new roads since the last update on 5/28/2014; geocoding improvements
- **Utah:** Received centerline update 6/23/2014: added new roads since the last update on 5/28/2014; geocoding improvements
- **Washington:** Received centerline update 5/29/2014: added new roads, road names, and address ranges; geocoding improvements
- **Weber:** Received centerline update 6/24/2014: added new roads, road name and address range changes since 5/1/2014; geocoding improvements

Blue Stakes of Utah Feedback:

- **Box Elder:** geocoding improvements
- **Cache:** geocoding improvements
- **Davis:** geocoding improvements
- **Morgan:** geocoding improvements
- **Salt Lake:** geocoding improvements
- **Summit:** geocoding improvements
- **Utah:** geocoding improvements
- **Uintah:** geocoding improvements
- **Wasatch:** geocoding improvements
- **Washington:** geocoding improvements
- **Weber:** geocoding improvements

UDOT Route System:

- The DOT\_F\_MP (From Milepost) and DOT\_T\_MP (To Milepost) fields that store the milepost attributes of the UDOT state and federal routes in SGID10.Transportation.Roads were updated
- The DOT_RTID field that stores UDOT's unique numeric route identifiers was updated


text:
package org.bkpathak.ds.linklist;

/**
 * Created by bijay on 1/24/16.
 * Basic Least Recently Used Cache Implementation
 *
 */
public class LRUCache {
    // A QNode implemented using doubly LinkedList
    class QNode {
        QNode prev, next;
        int pageNumber;

        QNode(int pageNumber) {
            this.pageNumber = pageNumber;
            this.prev = null;
            this.next = null;
        }
    }

    // A Hash pointing to the QNode
    class Hash {
        int capacity; // Capacity of Hash
        QNode[] array; // An array of QNode

        Hash(int capacity) {
            this.capacity = capacity;
            // Array of pointers to refer to QNode
            this.array = new QNode[capacity];
            //Initialize it to NULL
            for (int i = 0; i < this.capacity; i++) {
                this.array[i] = null;
            }
        }
    }

    // A Cache implementation of QNode
    int count; // Number of filled frames in Cache
    int totalFrame; // Total number of frame available
    QNode front, rear;
    Hash hash;

    // Create Queue to hold at most totalFrame
    LRUCache(int totalFrame) {
        this.count = 0;
        this.front = this.rear = null;
        this.totalFrame = totalFrame;
        this.hash = new Hash(totalFrame);
    }

    // Check if the frames are full or not.
    boolean areFramesFull(){
        return this.count == this.totalFrame;
    }

    // Check if Cache is empty
    boolean isCacheEmpty(){
        return this.rear == null;
    }

    // Delete frame from Cache(Queueu)
    // We'll always remove from the rear of the cache list
    void deleteFrame(){
        if (!isCacheEmpty()){
            // If this is only node in cache , then change front
            if (this.front == this.rear){
                this.front = null;
            }

            //Move the rear to previous
            this.rear = rear.prev;
            // Set the rear next to null
            this.rear.next = null;

            // Decrease the count of frames in cache
            this.count --;
        }
    }

    // Add page to Cache and Hash.
    // We'll add the page at the front of the cache list
    // And put the page in the hash with pageNumber as Key
    void addFrame(int pageNumber){
        // If cache is full, remove the element from the rear of the cache list
        if (areFramesFull()){
           deleteFrame();
       }
        // Create the new node  with given page number
        QNode new_node = new QNode(pageNumber);
        // Add the node to the front of the queue
        new_node.next = this.front;

        // If cache is empty, change both front and rear to point to the new_node
        if (isCacheEmpty()){
            this.front = this.rear = new_node;
        }
        else{
            // Change the front to point to the new_node
            this.front.prev = new_node;
            this.front = new_node;
        }

        // Add page entry to the Hash
        this.hash.array[pageNumber] = new_node;

        // Increase the count of frames
        this.count ++;
    }

    // If page is not in cache; bring the page and add to the front of the cache.
    // If already present in cache; move the page to the front of the cache
    void referencePage(int pageNumber){
        QNode requestPage = this.hash.array[pageNumber];

        // If page is not in cache
        if (requestPage == null){
            this.addFrame(pageNumber);
        }
        else{
            // Page is already in cache; move it to the front of the cache.
            // First remove the page from it's current location
            requestPage.prev.next = requestPage.next;

            // Check if requestPage is the rear node in the cache list
            if (requestPage == this.rear){
                this.rear = requestPage.prev;
                this.rear.next = null;
            }

            // Put the requestPage at the front of the cache list
            requestPage.next = this.front;
            requestPage.prev = null;

            // Change the previous of current front to point to the requestPage
            this.front.prev = requestPage;

            // Change the front to point to the requestPage;
            this.front = requestPage;
        }
    }

    void displayCache(){
        // Display the current pages in Cache
        QNode temp = this.front;
        while(temp != null){
            System.out.print(temp.pageNumber + " ");
            temp = temp.next;
        }
        System.out.println();
    }

    public static void main(String[] args){
        // Create the LRU Cache of size 10
        LRUCache cache = new LRUCache(10);

        // Page referenced are numbered from 0 to 9.
        // The order of reference is
        // 3 -> 6 -> 8 -> 3 -> 1 -> 2 -> 6
        System.out.println("Page reference order: 3 -> 6 -> 8 -> 3 -> 1 -> 2 -> 6");

        cache.referencePage(3);
        cache.referencePage(6);
        cache.referencePage(8);
        System.out.print("Current pages in Cache: ");
        cache.displayCache();
        System.out.println("Page 3 is reference again.");
        cache.referencePage(3);
        cache.displayCache();
        cache.referencePage(1);
        cache.referencePage(2);
        cache.referencePage(6);
        System.out.print("Current pages in Cache: ");
        cache.displayCache();
    }
}


text:
            <form class="horizontal-form" #questionForm="ngForm" novalidate (ngSubmit)="save()">

                    <input type="text" id="title" name="title" [(ngModel)]="question.title" #title="ngModel" required autoFocus class="form-control input-lg"
                        placeholder="标题:一句话说清问题,用问号结尾" />
                    {{l("Articles.TitleInfo",64)}}

                    <input type="text" class="form-control" placeholder="标签,如:php 可使用逗号,分号;分隔">

                        <textarea id="content" name="content" [(ngModel)]="question.content" required #content="ngModel"></textarea>

                    {{l("Articles.TitleInfo",64)}}

                    <button type="submit" class="btn green" [disabled]="!questionForm.form.valid || saving" [buttonBusy]="saving" [busyText]="l('SavingWithThreeDot')">

                        {{l("Save")}}
                    </button>

            </form>


text:
package org.estatio.dom.financial.contributed;

import java.util.List;

import org.apache.isis.applib.annotation.*;
import org.apache.isis.applib.annotation.ActionSemantics.Of;
import org.apache.isis.applib.annotation.NotContributed.As;

import org.estatio.dom.UdoDomainService;
import org.estatio.dom.RegexValidation;
import org.estatio.dom.financial.FinancialAccount;
import org.estatio.dom.financial.FinancialAccountType;
import org.estatio.dom.financial.FinancialAccounts;
import org.estatio.dom.party.Party;

@DomainService(menuOrder = "30")
@Hidden
public class FinancialAccountContributions extends UdoDomainService<FinancialAccountContributions> {

    public FinancialAccountContributions() {
        super(FinancialAccountContributions.class);
    }

    @ActionSemantics(Of.NON_IDEMPOTENT)
    @NotInServiceMenu
    @MemberOrder(name = "Financial Accounts", sequence = "13")
    public FinancialAccount addAccount(
            final Party owner,
            final FinancialAccountType financialAccountType,
            final @Named("Reference") @RegEx(validation = RegexValidation.REFERENCE, caseSensitive = true) String reference,
            final @Named("Name") String name) {
        FinancialAccount account = financialAccountType.create(getContainer());
        account.setOwner(owner);
        account.setReference(reference);
        account.setName(name);
        persistIfNotAlready(account);
        return account;
    }

    // //////////////////////////////////////

    @ActionSemantics(Of.SAFE)
    @NotInServiceMenu
    @NotContributed(As.ACTION)
    @MemberOrder(name = "Financial Accounts", sequence = "13.5")
    public List<FinancialAccount> financialAccounts(final Party owner) {
        return financialAccounts.findAccountsByOwner(owner);
    }

    // //////////////////////////////////////

    private FinancialAccounts financialAccounts;

    public void injectFinancialAccounts(final FinancialAccounts financialAccounts) {
        this.financialAccounts = financialAccounts;
    }

}


text:
module Asm8051
  class RAMemory < Memory
    def write(hex_location, hex_value)
      hash[hex_location.value.to_s(16)] = hex_value.value.to_s(16)
    end
  end
end


text:
// Copyright (C) 2011-2012 by Tapjoy Inc.
//
// This file is part of the Tapjoy SDK.
//
// By using the Tapjoy SDK in your software, you agree to the terms of the Tapjoy SDK License Agreement.
//
// The Tapjoy SDK is bound by the Tapjoy SDK License Agreement and can be found here: https://www.tapjoy.com/sdk/license

#import "TJCLocalPurchasedItems.h"
#import "TJCVGNotificationsConstants.h"
#import "TJCSqliteController.h"
#import "TapjoyConnect.h"
#import "TJCLog.h"
#import "TJCVGViewHandler.h"
#import "TJCVGStoreManager.h"
#import "TJCVGStoreModel.h"
#import "SynthesizeSingleton.h"

@implementation TJCLocalPurchasedItems

TJC_SYNTHESIZE_SINGLETON_FOR_CLASS(TJCLocalPurchasedItems)

/**
 * Add local data update observers
 */
- (void)addLocalDataUpdateObservers
{
	// Add observers
	[[NSNotificationCenter defaultCenter] addObserver:self
											 selector:@selector(localDataUpdateErrorSelector:)
												 name:SUBMIT_PURCHASED_VG_STORE_ITEMS_INTERNET_ERROR_RECIEVE_DATA
											   object:nil];
	[[NSNotificationCenter defaultCenter] addObserver:self
											 selector:@selector(localDataUpdateErrorSelector:)
												 name:SUBMIT_PURCHASED_VG_STORE_ITEMS_INTERNET_ERROR_RECIEVE_DATA
											   object:nil];
	[[NSNotificationCenter defaultCenter] addObserver:self
											 selector:@selector(localDataUpdateReceievedSelector:)
												 name:SUBMIT_PURCHASED_VG_STORE_ITEMS_RECIEVE_DATA
											   object:nil];
}

/**
 * Remove local data update observers
 */
- (void)removeLocalDataUpdateObservers
{
	// Remove observers
	[[NSNotificationCenter defaultCenter] removeObserver:self name:SUBMIT_PURCHASED_VG_STORE_ITEMS_INTERNET_ERROR_RECIEVE_DATA object:nil];
	[[NSNotificationCenter defaultCenter] removeObserver:self name:SUBMIT_PURCHASED_VG_STORE_ITEMS_INTERNET_ERROR_RECIEVE_DATA object:nil];
	[[NSNotificationCenter defaultCenter] removeObserver:self name:SUBMIT_PURCHASED_VG_STORE_ITEMS_RECIEVE_DATA object:nil];
}

/**
 * Local data update error
 */
- (void)localDataUpdateErrorSelector:(id)sender
{
	[self removeLocalDataUpdateObservers];
}

/**
 * Local data updated. Compare with local data
 */
-(void)localDataUpdateReceievedSelector:(id)sender
{
	[self removeLocalDataUpdateObservers];

	int newCount = [[[[TJCVGStoreManager sharedTJCVGStoreManager] vgStoreModelObj] purchasedItems] count];
	int oldCount = [[TJCSqliteController sharedTJCSqliteController] purchasedItemsCount];
	if (newCount > oldCount)
	{
		// Data update required
		UIAlertView *av = [[UIAlertView alloc] initWithTitle:nil
													 message:@"New purchased item update available\nDo you want to update ?"
													delegate:self
										   cancelButtonTitle:@"NO"
										   otherButtonTitles:@"YES", nil];
		[av show];
		[av release];
	}
	else if (newCount < oldCount)
	{

		[TJCLog logWithLevel:LOG_DEBUG format:@"Insane scenario. Local purchased item exceded remote server."];
	}
}

/**
 * Handle user request for update
 */
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
	if (buttonIndex == 0)
	{ // Do not update local records
		[TJCLog logWithLevel:LOG_DEBUG format:@"User refused to get purchased item updates."];
		// Release memory
		[[[TJCVGStoreManager sharedTJCVGStoreManager] vgStoreModelObj] releasePurchasedItems];
    }
	else if (buttonIndex == 1)
	{ // YES, (I want to update virtual good data)
		UIView *callingApplicationView = (UIWindow*)[[[UIApplication sharedApplication] windows] objectAtIndex:0];

		// Open view with purchased item tab selected
		[callingApplicationView addSubview:[[TJCVGViewHandler sharedTJCVGViewHandler] getVirtualGoodsWithTab:2]];
    }
}

/**
 * Returns StoreItem object list.
 * Releasing objects is responsibility of user
 */
- (NSMutableArray*)getPurchasedVGStoreItemsArray
{
	NSMutableArray *localItemObjArray = [[TJCSqliteController sharedTJCSqliteController] getAllPurchasedItems];
	NSMutableArray *storeItemArray = [[NSMutableArray alloc] init];

	for (int i = 0; i < [localItemObjArray count]; i++)
	{
		StoreItem *obj = [[StoreItem alloc] initWithObject:[localItemObjArray objectAtIndex:i]];
		[storeItemArray addObject:obj];
		[obj release];
	}

	return storeItemArray;
}

- (NSMutableArray*)getVGStoreItemsArray
{
	return [self getPurchasedVGStoreItemsArray];
}

/**
 * Release memory
 */
-(void)dealloc
{
	[super dealloc];
}

@end


text:
package com.bj58.oceanus.exchange.nodes.value.impl;

import com.bj58.oceanus.core.shard.AnalyzeResult;
import com.bj58.oceanus.exchange.nodes.AbstractNodeAnalyzer;
import com.bj58.sql.parser.ConditionalNode;
import com.bj58.sql.parser.NodeTypes;

/**
 * SQL节点解析器:ConditionalNodeAnalyzer
 *
 * @author Service Platform Architecture Team (spat@58.com)
 */
public class ConditionalNodeAnalyzer extends
		AbstractNodeAnalyzer<ConditionalNode, AnalyzeResult> {
	int[] nodeTypes = { NodeTypes.CONDITIONAL_NODE };

	@Override
	public int[] getNodeTypes() {
		return nodeTypes;
	}

	@Override
	public AnalyzeResult doAnalyze(ConditionalNode node) {
		// TODO Auto-generated method stub
		return null;
	}

}


text:
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

/**
 * @fileoverview
 * 'settings-section' shows a paper material themed section with a header
 * which shows its page title.
 *
 * Example:
 *
 *    <settings-section page-title="[[pageTitle]]" section="privacy">
 *      <!-- Insert your section controls here -->
 *    </settings-section>
 *
 * @group Chrome Settings Elements
 * @element settings-section
 */
Polymer({
  is: 'settings-section',

  behaviors: [
    Polymer.NeonAnimationRunnerBehavior,
  ],

  properties: {
    /**
     * The current active route.
     */
    currentRoute: {
      type: Object,
      observer: 'currentRouteChanged_',
    },

    /**
     * The section is expanded to a full-page view when this property matches
     * currentRoute.section.
     *
     * The section name must match the name specified in settings_router.js.
     */
    section: {
      type: String,
    },

    /**
     * Title for the page header and navigation menu.
     */
    pageTitle: String,

    animationConfig: {
      value: function() {
        return {
          collapse: {
            name: 'collapse-card-animation',
            node: this,
          },
          expand: {
            name: 'expand-card-animation',
            node: this,
          },
        };
      },
    },
  },

  listeners: {
    'expand-animation-complete': 'onExpandAnimationComplete_',
  },

  /** @private */
  currentRouteChanged_: function(newRoute, oldRoute) {
    var newExpanded = newRoute.section == this.section;
    var oldExpanded = oldRoute && oldRoute.section == this.section;

    var visible = newExpanded || this.currentRoute.section == '';

    // If the user navigates directly to a subpage, skip all the animations.
    if (!oldRoute) {
      if (newExpanded) {
        // If we navigate directly to a subpage, skip animations.
        this.classList.add('expanded');
      } else if (!visible) {
        this.hidden = true;
        this.$.card.elevation = 0;
      }

      return;
    }

    if (newExpanded && !oldExpanded) {
      this.playAnimation('expand');
    } else if (oldExpanded && !newExpanded) {
      // For contraction, we defer the animation to allow
      // settings-animated-pages to reflow the new page correctly.
      this.async(function() {
        this.playAnimation('collapse');
      }.bind(this));
    }

    this.$.card.elevation = visible ? 1 : 0;

    // Remove 'hidden' class immediately, but defer adding it if we are invisble
    // until the animation is complete.
    if (visible)
      this.hidden = false;
  },

  /** @private */
  onExpandAnimationComplete_: function() {
    this.hidden = this.currentRoute.section != '' &&
                  this.currentRoute.section != this.section;
  },
});

Polymer({
  is: 'expand-card-animation',

  behaviors: [
    Polymer.NeonAnimationBehavior
  ],

  configure: function(config) {
    var section = config.node;
    var card = section.$.card;
    var containerRect = section.offsetParent.getBoundingClientRect();
    var cardRect = card.getBoundingClientRect();

    // Set placeholder height so the page does not reflow during animation.
    // TODO(tommycli): For URLs that directly load subpages, this does not work.
    var placeholder = section.$.placeholder;
    placeholder.style.top = card.offsetTop + 'px';
    placeholder.style.height = card.offsetHeight + 'px';

    section.classList.add('neon-animating');

    this._effect = new KeyframeEffect(card, [
      {'top': cardRect.top + 'px', 'height': cardRect.height + 'px'},
      {'top': containerRect.top + 'px', 'height': containerRect.height + 'px'},
    ], this.timingFromConfig(config));
    return this._effect;
  },

  complete: function(config) {
    var section = config.node;
    section.classList.remove('neon-animating');
    section.classList.add('expanded');

    // This event fires on itself as well, but that is benign.
    var sections = section.parentNode.querySelectorAll('settings-section');
    for (var i = 0; i < sections.length; ++i) {
      sections[i].fire('expand-animation-complete');
    }
  }
});

Polymer({
  is: 'collapse-card-animation',

  behaviors: [
    Polymer.NeonAnimationBehavior
  ],

  configure: function(config) {
    var section = config.node;
    var oldRect = section.offsetParent.getBoundingClientRect();

    section.classList.remove('expanded');

    var card = section.$.card;
    var placeholder = section.$.placeholder;
    placeholder.style.top = card.offsetTop + 'px';
    placeholder.style.height = card.offsetHeight + 'px';

    var newRect = card.getBoundingClientRect();

    section.classList.add('neon-animating');

    this._effect = new KeyframeEffect(card, [
      {'top': oldRect.top + 'px', 'height': oldRect.height + 'px'},
      {'top': newRect.top + 'px', 'height': newRect.height + 'px'},
    ], this.timingFromConfig(config));
    return this._effect;
  },

  complete: function(config) {
    config.node.classList.remove('neon-animating');
  }
});


text:
{% load i18n %}
{% load url from future %}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

    <title>MikaelochMaria.se's blogg - {% block title %}{% endblock %}</title>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <meta http-equiv="cache-control" content="public" />
    <meta name="robots" content="follow, all" />
    <meta name="language" content="{{ LANGUAGE_CODE }}" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="description" content="{% block meta-description %}{% endblock %}" />
    <meta name="keywords" content="{% block meta-keywords %}django, blog, zinnia{% endblock %}" />
    <meta name="author" content="Fantomas42" />
    {% block meta %}{% endblock %}
    <link rel="pingback" href="/xmlrpc/" />
    <link rel="home" href="{% url 'zinnia_entry_archive_index' %}" />
    <link rel="stylesheet" type="text/css" media="screen, projection" href="{{ STATIC_URL }}zinnia/css/screen.css" />
    <link rel="stylesheet" type="text/css" media="print" href="{{ STATIC_URL }}zinnia/css/print.css" />

    {% block link %}{% endblock %}
    {% block script %}{% endblock %}

              {% trans "Sitemap" %}

              {% trans "RSS Feed" %}

        <form method="get" action="{% url 'zinnia_entry_search' %}">

            <input type="text" value="{% trans "Keywords..." %}" name="pattern" onfocus="this.value=''" />
            <input type="submit" class="submitbutton" value="OK" />

        </form>

            Tillbaka till MikaelochMaria.se

        {% block breadcrumbs %}{% endblock %}

      {% block slider %}{% endblock %}

        {% block content %}

{% trans "Useful links" %}

                {% trans "Blog index" %}

                {% trans "Sitemap" %}

{% trans "Search" %}

          {% include "zinnia/tags/search_form.html" %}

        {% endblock %}

        {% block sidebar %}
        {% endblock %}


text:
if [ ! -f expected ]; then
 bash jobs/make_expected_file.sh
fi
perl scripts/combine_fasaln.pl -o all.Roz200.fasaln -of fasta -d aln/Roz200 -expected expected

#bp_sreformat.pl -if fasta -of nexus --special=mrbayes -i all.Roz200.fasaln -o all.Roz200.nex


text:
package decorator.pages.shoppingcartpage;

import decorator.core.BaseAssertions;
import org.testng.Assert;

public class ShoppingCartAssertions extends BaseAssertions<ShoppingCartElements> {
    public void assertShoppingCartSubtotalPrice(double subtotalPrice) {
        Assert.assertEquals(elements().shoppingCartSubtotalPrice().getText(), formatCurrency(subtotalPrice));
    }
}


text:
'use strict'

module.exports = App.NoderPlayNotification = Ember.Object.extend({

});

App.NoderPlayNotification.reopenClass({
  success: function(message) {
    if($(".alert-message").hasClass("alert-danger")) {
      $(".alert-message").removeClass("alert-danger")
    }
    if(message) {
      $(".alert-message").addClass("alert alert-success").fadeIn().fadeOut(5000).html(message);
    }
  },

  failure: function(message) {
    if($(".alert-message").hasClass("alert-success")) {
      $(".alert-message").removeClass("alert-success")
    }
    if(message) {
      $(".alert-message").addClass("alert alert-danger").fadeIn().fadeOut(5000).html(message);
    }
  }
});


text:
package net.ozwolf.raml.exception;

import org.raml.v2.api.model.common.ValidationResult;

import java.util.List;

import static java.util.stream.Collectors.toList;

public class RamlValidationException extends Exception {
    private final List<String> errors;

    public RamlValidationException(String message, List<ValidationResult> errors) {
        super(message);
        this.errors = errors.stream().map(v -> v.getMessage()).collect(toList());
    }

    public List<String> getErrors() {
        return errors;
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

    <modelVersion>4.0.0</modelVersion>

    <parent>
        <artifactId>chinook-java-spring</artifactId>
        <groupId>org.gislers.chinook</groupId>
        <version>1.0-SNAPSHOT</version>
        <relativePath>../pom.xml</relativePath>
    </parent>

    <artifactId>chinook-persistence</artifactId>
    <packaging>jar</packaging>

    <dependencies>

        <dependency>
            <groupId>org.gislers.chinook</groupId>
            <artifactId>chinook-entities</artifactId>
        </dependency>

        <!--MySQL JDBC driver-->
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>javax</groupId>
            <artifactId>javaee-api</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-beans</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-tx</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-jdbc</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-orm</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.data</groupId>
            <artifactId>spring-data-jpa</artifactId>
        </dependency>

        <!-- Hibernate -->
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-entitymanager</artifactId>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-validator</artifactId>
        </dependency>

        <!-- Logging with SLF4J & LogBack -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
        </dependency>
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
        </dependency>

        <!-- Test -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>simple-jndi</groupId>
            <artifactId>simple-jndi</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

</project>


text:
#import "AccountDetails.h"

@class NSButton, NSTextField;

@interface EWSAccountDetails : AccountDetails
{
    NSTextField *_internalServerPath;
    NSTextField *_externalServerPath;
    NSTextField *_externalPortNumber;
    NSButton *_externalUseSSL;
    BOOL _warnedAboutCachingAndIndexing;
    NSButton *_cachePolicyCheckbox;
}

@property(nonatomic) NSButton *cachePolicyCheckbox; // @synthesize cachePolicyCheckbox=_cachePolicyCheckbox;
- (void)cachePolicyChanged:(id)arg1;
- (void)didDisplayTabViewItem:(id)arg1;
- (id)portFieldForSSLCheckBox:(id)arg1;
- (BOOL)isAccountInformationDirty:(id)arg1;
- (void)setUIElementsEnabled:(BOOL)arg1;
- (void)setupAccountFromValuesInUI:(id)arg1 forValidation:(BOOL)arg2;
- (void)setupUIFromValuesInAccount:(id)arg1;

@end


text:
package gov.hhs.onc.dcdt.service.mail.smtp.command.impl;

import gov.hhs.onc.dcdt.mail.smtp.SmtpCommandException;
import gov.hhs.onc.dcdt.mail.smtp.SmtpReply;
import gov.hhs.onc.dcdt.mail.smtp.SmtpReplyCode;
import gov.hhs.onc.dcdt.mail.smtp.command.SmtpCommandType;
import gov.hhs.onc.dcdt.mail.smtp.command.impl.QuitCommand;
import gov.hhs.onc.dcdt.mail.smtp.impl.SmtpReplyImpl;
import gov.hhs.onc.dcdt.service.mail.server.MailGateway;
import gov.hhs.onc.dcdt.service.mail.smtp.SmtpServerConfig;
import gov.hhs.onc.dcdt.service.mail.smtp.SmtpServerSession;
import io.netty.channel.Channel;
import org.springframework.stereotype.Component;

@Component("smtpCmdProcQuit")
public class QuitCommandProcessor extends AbstractSmtpCommandProcessor<QuitCommand> {
    public QuitCommandProcessor() {
        super(SmtpCommandType.QUIT);
    }

    @Override
    public SmtpReply process(Channel channel, MailGateway gateway, SmtpServerConfig config, SmtpServerSession session, QuitCommand cmd)
        throws SmtpCommandException {
        return new SmtpReplyImpl(SmtpReplyCode.SYSTEM_QUIT, String.format("%s closing connection", config.getHeloName().toString(true)));
    }
}


text:
function [ cost, grad ] = deepSoftmaxCost(theta, inputSize, hiddenSize, ...
                                              numClasses, lambda, ...
                                              data, labels)

% stackedAECost: Takes a trained softmaxTheta and a training data set with labels,
% and returns cost and gradient using a stacked autoencoder model. Used for
% finetuning.

% theta: trained weights from the autoencoder
% visibleSize: the number of input units
% hiddenSize:  the number of hidden units *at the 2nd layer*
% numClasses:  the number of categories
% lambda:      the weight regularization penalty
% data: Our matrix containing the training data as columns.  So, data(:,i) is the i-th training example.
% labels: A vector containing labels, where labels(i) is the label for the
% i-th training example

%% Unroll softmaxTheta parameter

% We first extract the part which compute the softmax gradient
softmaxTheta = reshape(theta(1:hiddenSize*numClasses), numClasses, hiddenSize);

% Extract out the "stack"
stack = cell(1,1);
stack{1} = struct;
stack{1}.w = reshape(theta(hiddenSize*numClasses+1:end-hiddenSize), hiddenSize, inputSize);
stack{1}.b = reshape(theta(end-hiddenSize+1:end), hiddenSize, 1);

% You will need to compute the following gradients
softmaxThetaGrad = zeros(size(softmaxTheta));
stackgrad = cell(size(stack));
for d = 1:numel(stack)
    stackgrad{d}.w = zeros(size(stack{d}.w));
    stackgrad{d}.b = zeros(size(stack{d}.b));
end

cost = 0; % You need to compute this

% You might find these variables useful
M = size(data, 2);
groundTruth = full(sparse(labels, 1:M, 1));

%% --------------------------- YOUR CODE HERE -----------------------------
%  Instructions: Compute the cost function and gradient vector for
%                the stacked autoencoder.
%
%                You are given a stack variable which is a cell-array of
%                the weights and biases for every layer. In particular, you
%                can refer to the weights of Layer d, using stack{d}.w and
%                the biases using stack{d}.b . To get the total number of
%                layers, you can use numel(stack).
%
%                The last layer of the network is connected to the softmax
%                classification layer, softmaxTheta.
%
%                You should compute the gradients for the softmaxTheta,
%                storing that in softmaxThetaGrad. Similarly, you should
%                compute the gradients for each layer in the stack, storing
%                the gradients in stackgrad{d}.w and stackgrad{d}.b
%                Note that the size of the matrices in stackgrad should
%                match exactly that of the size of the matrices in stack.
%
outLay = numel(stack) + 2;
a = cell( outLay);
z = cell( outLay);
delta = cell( outLay);

% Forward computing
a{1} = data;
for d=1:numel(stack)
    l = d + 1;      % layer index, from input to output
    ah = [ones(1, size(a{d},2)); a{d}];
    wh = [stack{d}.b stack{d}.w];
    z{l} = wh * ah;
    a{l} = sigmoid(z{l});
end
z{outLay} = softmaxTheta * a{outLay - 1};
a{outLay} = exp(z{outLay});
hvalue = a{outLay} ./ repmat( sum(a{outLay},1), size(a{outLay},1), 1);

% cost computing
wr = 0;
for d=1:numel(stack)
    wr = wr + sum(sum(stack{d}.w.^2));
end
wr = wr + sum(sum(softmaxTheta.^2));

cost = -1 * sum(sum(log(hvalue).*groundTruth)) / M + 0.5 * lambda * wr;

% backpropagation
delta{outLay} = -1 * (groundTruth - hvalue);
softmaxThetaGrad = softmaxThetaGrad + delta{outLay} * a{outLay-1}' / M + lambda * softmaxTheta;

delta{outLay-1} = softmaxTheta' * delta{outLay} .* a{outLay-1} .* ( 1 - a{outLay-1});

for d=numel(stack):-1:1
    l = d;
    stackgrad{d}.w = stackgrad{d}.w + delta{l+1} * a{l}' / M + lambda * stack{d}.w;
    stackgrad{d}.b = stackgrad{d}.b + sum(delta{l+1},2)/ M;
    delta{l} = stack{d}.w' * delta{l+1} .* a{l} .* (1-a{l});
end

% -------------------------------------------------------------------------

%% Roll gradient vector
grad = [softmaxThetaGrad(:) ; stackgrad{1}.w(:); stackgrad{1}.b(:)];

end

% You might find this useful
function sigm = sigmoid(x)
    sigm = 1 ./ (1 + exp(-x));
end


text:
Except::Except(const std::string &msg, const int cd): message(msg), code(cd){
}

Except::~Except(){
}

Except::Except():message(""), code(0){
}

Except& Except::operator=(const Except &other){
  (void)other;
  return *this;
}


text:
/* Demo of how to construct your own engine and using it.  The basis of this
   engine is RSAref, an old reference of the RSA algorithm which can still
   be found a little here and there. */

#include <stdio.h>
#include <string.h>
#include "./source/global.h"
#include "./source/rsaref.h"
#include "./source/rsa.h"
#include "./source/des.h"
#include <openssl/err.h>
#define OPENSSL_NO_MD2
#define OPENSSL_NO_MD5
#include <openssl/evp.h>
#include <openssl/bn.h>
#include <openssl/engine.h>

#define RSAREF_LIB_NAME "rsaref engine"
#include "rsaref_err.c"

/*****************************************************************************
 *** Function declarations and global variable definitions                 ***
 *****************************************************************************/

/*****************************************************************************
 * Constants used when creating the ENGINE
 **/
static const char *engine_rsaref_id = "rsaref";
static const char *engine_rsaref_name = "RSAref engine support";

/*****************************************************************************
 * Functions to handle the engine
 **/
static int rsaref_destroy(ENGINE *e);
static int rsaref_init(ENGINE *e);
static int rsaref_finish(ENGINE *e);
#if 0
static int rsaref_ctrl(ENGINE *e, int cmd, long i, void *p, void (*f)());
#endif

/*****************************************************************************
 * Engine commands
 **/
static const ENGINE_CMD_DEFN rsaref_cmd_defns[] = {
	{0, NULL, NULL, 0}
	};

/*****************************************************************************
 * RSA functions
 **/
static int rsaref_private_decrypt(int len, const unsigned char *from,
	unsigned char *to, RSA *rsa, int padding);
static int rsaref_private_encrypt(int len, const unsigned char *from,
	unsigned char *to, RSA *rsa, int padding);
static int rsaref_public_encrypt(int len, const unsigned char *from,
	unsigned char *to, RSA *rsa, int padding);
static int rsaref_public_decrypt(int len, const unsigned char *from,
	unsigned char *to, RSA *rsa, int padding);
static int bnref_mod_exp(BIGNUM *r,const BIGNUM *a,const BIGNUM *p,const BIGNUM *m,
			  BN_CTX *ctx, BN_MONT_CTX *m_ctx);
static int rsaref_mod_exp(BIGNUM *r0, const BIGNUM *I, RSA *rsa);

/*****************************************************************************
 * Our RSA method
 **/
static RSA_METHOD rsaref_rsa =
{
  "RSAref PKCS#1 RSA",
  rsaref_public_encrypt,
  rsaref_public_decrypt,
  rsaref_private_encrypt,
  rsaref_private_decrypt,
  rsaref_mod_exp,
  bnref_mod_exp,
  NULL,
  NULL,
  0,
  NULL,
  NULL,
  NULL
};

/*****************************************************************************
 * Symetric cipher and digest function registrars
 **/
static int rsaref_ciphers(ENGINE *e, const EVP_CIPHER **cipher,
	const int **nids, int nid);
static int rsaref_digests(ENGINE *e, const EVP_MD **digest,
	const int **nids, int nid);

static int rsaref_cipher_nids[] =
	{ NID_des_cbc, NID_des_ede3_cbc, NID_desx_cbc, 0 };
static int rsaref_digest_nids[] =
	{ NID_md2, NID_md5, 0 };

/*****************************************************************************
 * DES functions
 **/
static int cipher_des_cbc_init(EVP_CIPHER_CTX *ctx, const unsigned char *key,
	const unsigned char *iv, int enc);
static int cipher_des_cbc_code(EVP_CIPHER_CTX *ctx, unsigned char *out,
	const unsigned char *in, unsigned int inl);
static int cipher_des_cbc_clean(EVP_CIPHER_CTX *);
static int cipher_des_ede3_cbc_init(EVP_CIPHER_CTX *ctx, const unsigned char *key,
	const unsigned char *iv, int enc);
static int cipher_des_ede3_cbc_code(EVP_CIPHER_CTX *ctx, unsigned char *out,
	const unsigned char *in, unsigned int inl);
static int cipher_des_ede3_cbc_clean(EVP_CIPHER_CTX *);
static int cipher_desx_cbc_init(EVP_CIPHER_CTX *ctx, const unsigned char *key,
	const unsigned char *iv, int enc);
static int cipher_desx_cbc_code(EVP_CIPHER_CTX *ctx, unsigned char *out,
	const unsigned char *in, unsigned int inl);
static int cipher_desx_cbc_clean(EVP_CIPHER_CTX *);

/*****************************************************************************
 * Our DES ciphers
 **/
static const EVP_CIPHER cipher_des_cbc =
	{
	NID_des_cbc,
	8, 8, 8,
	0 | EVP_CIPH_CBC_MODE,
	cipher_des_cbc_init,
	cipher_des_cbc_code,
	cipher_des_cbc_clean,
	sizeof(DES_CBC_CTX),
	NULL,
	NULL,
	NULL,
	NULL
	};

static const EVP_CIPHER cipher_des_ede3_cbc =
	{
	NID_des_ede3_cbc,
	8, 24, 8,
	0 | EVP_CIPH_CBC_MODE,
	cipher_des_ede3_cbc_init,
	cipher_des_ede3_cbc_code,
	cipher_des_ede3_cbc_clean,
	sizeof(DES3_CBC_CTX),
	NULL,
	NULL,
	NULL,
	NULL
	};

static const EVP_CIPHER cipher_desx_cbc =
	{
	NID_desx_cbc,
	8, 24, 8,
	0 | EVP_CIPH_CBC_MODE,
	cipher_desx_cbc_init,
	cipher_desx_cbc_code,
	cipher_desx_cbc_clean,
	sizeof(DESX_CBC_CTX),
	NULL,
	NULL,
	NULL,
	NULL
	};

/*****************************************************************************
 * MD functions
 **/
static int digest_md2_init(EVP_MD_CTX *ctx);
static int digest_md2_update(EVP_MD_CTX *ctx,const void *data,
	unsigned long count);
static int digest_md2_final(EVP_MD_CTX *ctx,unsigned char *md);
static int digest_md5_init(EVP_MD_CTX *ctx);
static int digest_md5_update(EVP_MD_CTX *ctx,const void *data,
	unsigned long count);
static int digest_md5_final(EVP_MD_CTX *ctx,unsigned char *md);

/*****************************************************************************
 * Our MD digests
 **/
static const EVP_MD digest_md2 =
	{
	NID_md2,
	NID_md2WithRSAEncryption,
	16,
	0,
	digest_md2_init,
	digest_md2_update,
	digest_md2_final,
	NULL,
	NULL,
	EVP_PKEY_RSA_method,
	16,
	sizeof(MD2_CTX)
	};

static const EVP_MD digest_md5 =
	{
	NID_md5,
	NID_md5WithRSAEncryption,
	16,
	0,
	digest_md5_init,
	digest_md5_update,
	digest_md5_final,
	NULL,
	NULL,
	EVP_PKEY_RSA_method,
	64,
	sizeof(MD5_CTX)
	};

/*****************************************************************************
 *** Function definitions                                                  ***
 *****************************************************************************/

/*****************************************************************************
 * Functions to handle the engine
 **/

static int bind_rsaref(ENGINE *e)
	{
	const RSA_METHOD *meth1;
	if(!ENGINE_set_id(e, engine_rsaref_id)
		|| !ENGINE_set_name(e, engine_rsaref_name)
		|| !ENGINE_set_RSA(e, &rsaref_rsa)
		|| !ENGINE_set_ciphers(e, rsaref_ciphers)
		|| !ENGINE_set_digests(e, rsaref_digests)
		|| !ENGINE_set_destroy_function(e, rsaref_destroy)
		|| !ENGINE_set_init_function(e, rsaref_init)
		|| !ENGINE_set_finish_function(e, rsaref_finish)
		/* || !ENGINE_set_ctrl_function(e, rsaref_ctrl) */
		/* || !ENGINE_set_cmd_defns(e, rsaref_cmd_defns) */)
		return 0;

	/* Ensure the rsaref error handling is set up */
	ERR_load_RSAREF_strings();
	return 1;
	}

#ifdef ENGINE_DYNAMIC_SUPPORT
static int bind_helper(ENGINE *e, const char *id)
	{
	if(id && (strcmp(id, engine_rsaref_id) != 0))
		return 0;
	if(!bind_rsaref(e))
		return 0;
	return 1;
	}
IMPLEMENT_DYNAMIC_CHECK_FN()
IMPLEMENT_DYNAMIC_BIND_FN(bind_helper)
#else
static ENGINE *engine_rsaref(void)
	{
	ENGINE *ret = ENGINE_new();
	if(!ret)
		return NULL;
	if(!bind_rsaref(ret))
		{
		ENGINE_free(ret);
		return NULL;
		}
	return ret;
	}

void ENGINE_load_rsaref(void)
	{
	/* Copied from eng_[openssl|dyn].c */
	ENGINE *toadd = engine_rsaref();
	if(!toadd) return;
	ENGINE_add(toadd);
	ENGINE_free(toadd);
	ERR_clear_error();
	}
#endif

/* Initiator which is only present to make sure this engine looks available */
static int rsaref_init(ENGINE *e)
	{
	return 1;
	}

/* Finisher which is only present to make sure this engine looks available */
static int rsaref_finish(ENGINE *e)
	{
	return 1;
	}

/* Destructor (complements the "ENGINE_ncipher()" constructor) */
static int rsaref_destroy(ENGINE *e)
	{
	ERR_unload_RSAREF_strings();
	return 1;
	}

/*****************************************************************************
 * RSA functions
 **/

static int rsaref_mod_exp(BIGNUM *r0, const BIGNUM *I, RSA *rsa)
	{
	RSAREFerr(RSAREF_F_RSAREF_MOD_EXP,ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
	return(0);
	}

static int bnref_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
			  const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx)
	{
	RSAREFerr(RSAREF_F_BNREF_MOD_EXP,ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
	return(0);
	}

/* unsigned char *to:  [max]    */
static int RSAref_bn2bin(BIGNUM *from, unsigned char *to, int max)
	{
	int i;

	i=BN_num_bytes(from);
	if (i > max)
		{
		RSAREFerr(RSAREF_F_RSAREF_BN2BIN,RSAREF_R_LEN);
		return(0);
		}

	memset(to,0,(unsigned int)max);
	if (!BN_bn2bin(from,&(to[max-i])))
		return(0);
	return(1);
	}

#ifdef undef
/* unsigned char *from:  [max]    */
static BIGNUM *RSAref_bin2bn(unsigned char *from, BIGNUM *to, int max)
	{
	int i;
	BIGNUM *ret;

	for (i=0; i<max; i++)
		if (from[i]) break;

	ret=BN_bin2bn(&(from[i]),max-i,to);
	return(ret);
	}

static int RSAref_Public_ref2eay(RSArefPublicKey *from, RSA *to)
	{
	to->n=RSAref_bin2bn(from->m,NULL,RSAref_MAX_LEN);
	to->e=RSAref_bin2bn(from->e,NULL,RSAref_MAX_LEN);
	if ((to->n == NULL) || (to->e == NULL)) return(0);
	return(1);
	}
#endif

static int RSAref_Public_eay2ref(RSA *from, R_RSA_PUBLIC_KEY *to)
	{
	to->bits=BN_num_bits(from->n);
	if (!RSAref_bn2bin(from->n,to->modulus,MAX_RSA_MODULUS_LEN)) return(0);
	if (!RSAref_bn2bin(from->e,to->exponent,MAX_RSA_MODULUS_LEN)) return(0);
	return(1);
	}

#ifdef undef
static int RSAref_Private_ref2eay(RSArefPrivateKey *from, RSA *to)
	{
	if ((to->n=RSAref_bin2bn(from->m,NULL,RSAref_MAX_LEN)) == NULL)
		return(0);
	if ((to->e=RSAref_bin2bn(from->e,NULL,RSAref_MAX_LEN)) == NULL)
		return(0);
	if ((to->d=RSAref_bin2bn(from->d,NULL,RSAref_MAX_LEN)) == NULL)
		return(0);
	if ((to->p=RSAref_bin2bn(from->prime[0],NULL,RSAref_MAX_PLEN)) == NULL)
		return(0);
	if ((to->q=RSAref_bin2bn(from->prime[1],NULL,RSAref_MAX_PLEN)) == NULL)
		return(0);
	if ((to->dmp1=RSAref_bin2bn(from->pexp[0],NULL,RSAref_MAX_PLEN))
		== NULL)
		return(0);
	if ((to->dmq1=RSAref_bin2bn(from->pexp[1],NULL,RSAref_MAX_PLEN))
		== NULL)
		return(0);
	if ((to->iqmp=RSAref_bin2bn(from->coef,NULL,RSAref_MAX_PLEN)) == NULL)
		return(0);
	return(1);
	}
#endif

static int RSAref_Private_eay2ref(RSA *from, R_RSA_PRIVATE_KEY *to)
	{
	to->bits=BN_num_bits(from->n);
	if (!RSAref_bn2bin(from->n,to->modulus,MAX_RSA_MODULUS_LEN)) return(0);
	if (!RSAref_bn2bin(from->e,to->publicExponent,MAX_RSA_MODULUS_LEN)) return(0);
	if (!RSAref_bn2bin(from->d,to->exponent,MAX_RSA_MODULUS_LEN)) return(0);
	if (!RSAref_bn2bin(from->p,to->prime[0],MAX_RSA_PRIME_LEN)) return(0);
	if (!RSAref_bn2bin(from->q,to->prime[1],MAX_RSA_PRIME_LEN)) return(0);
	if (!RSAref_bn2bin(from->dmp1,to->primeExponent[0],MAX_RSA_PRIME_LEN)) return(0);
	if (!RSAref_bn2bin(from->dmq1,to->primeExponent[1],MAX_RSA_PRIME_LEN)) return(0);
	if (!RSAref_bn2bin(from->iqmp,to->coefficient,MAX_RSA_PRIME_LEN)) return(0);
	return(1);
	}

static int rsaref_private_decrypt(int len, const unsigned char *from, unsigned char *to,
	     RSA *rsa, int padding)
	{
	int i,outlen= -1;
	R_RSA_PRIVATE_KEY RSAkey;

	if (!RSAref_Private_eay2ref(rsa,&RSAkey))
		goto err;
	if ((i=RSAPrivateDecrypt(to,(unsigned int *)&outlen,(unsigned char *)from,len,&RSAkey)) != 0)
		{
		RSAREFerr(RSAREF_F_RSAREF_PRIVATE_DECRYPT,i);
		outlen= -1;
		}
err:
	memset(&RSAkey,0,sizeof(RSAkey));
	return(outlen);
	}

static int rsaref_private_encrypt(int len, const unsigned char *from, unsigned char *to,
	     RSA *rsa, int padding)
	{
	int i,outlen= -1;
	R_RSA_PRIVATE_KEY RSAkey;

	if (padding != RSA_PKCS1_PADDING)
		{
		RSAREFerr(RSAREF_F_RSAREF_PRIVATE_ENCRYPT, RSA_R_UNKNOWN_PADDING_TYPE);
		goto err;
	}
	if (!RSAref_Private_eay2ref(rsa,&RSAkey))
		goto err;
	if ((i=RSAPrivateEncrypt(to,(unsigned int *)&outlen,(unsigned char *)from,len,&RSAkey)) != 0)
		{
		RSAREFerr(RSAREF_F_RSAREF_PRIVATE_ENCRYPT,i);
		outlen= -1;
		}
err:
	memset(&RSAkey,0,sizeof(RSAkey));
	return(outlen);
	}

static int rsaref_public_decrypt(int len, const unsigned char *from, unsigned char *to,
	     RSA *rsa, int padding)
	{
	int i,outlen= -1;
	R_RSA_PUBLIC_KEY RSAkey;

	if (!RSAref_Public_eay2ref(rsa,&RSAkey))
		goto err;
	if ((i=RSAPublicDecrypt(to,(unsigned int *)&outlen,(unsigned char *)from,len,&RSAkey)) != 0)
		{
		RSAREFerr(RSAREF_F_RSAREF_PUBLIC_DECRYPT,i);
		outlen= -1;
		}
err:
	memset(&RSAkey,0,sizeof(RSAkey));
	return(outlen);
	}

static int rsaref_public_encrypt(int len, const unsigned char *from, unsigned char *to,
	     RSA *rsa, int padding)
	{
	int outlen= -1;
	int i;
	R_RSA_PUBLIC_KEY RSAkey;
	R_RANDOM_STRUCT rnd;
	unsigned char buf[16];

	if (padding != RSA_PKCS1_PADDING && padding != RSA_SSLV23_PADDING)
		{
		RSAREFerr(RSAREF_F_RSAREF_PUBLIC_ENCRYPT, RSA_R_UNKNOWN_PADDING_TYPE);
		goto err;
		}

	R_RandomInit(&rnd);
	R_GetRandomBytesNeeded((unsigned int *)&i,&rnd);
	while (i > 0)
		{
		if (RAND_bytes(buf,16) <= 0)
			goto err;
		R_RandomUpdate(&rnd,buf,(unsigned int)((i>16)?16:i));
		i-=16;
		}

	if (!RSAref_Public_eay2ref(rsa,&RSAkey))
		goto err;
	if ((i=RSAPublicEncrypt(to,(unsigned int *)&outlen,(unsigned char *)from,len,&RSAkey,&rnd)) != 0)
		{
		RSAREFerr(RSAREF_F_RSAREF_PUBLIC_ENCRYPT,i);
		outlen= -1;
		goto err;
		}
err:
	memset(&RSAkey,0,sizeof(RSAkey));
	R_RandomFinal(&rnd);
	memset(&rnd,0,sizeof(rnd));
	return(outlen);
	}

/*****************************************************************************
 * Symetric cipher and digest function registrars
 **/
static int rsaref_ciphers(ENGINE *e, const EVP_CIPHER **cipher,
	const int **nids, int nid)
	{
	int ok = 1;
	if(!cipher)
		{
		/* We are returning a list of supported nids */
		*nids = rsaref_cipher_nids;
		return (sizeof(rsaref_cipher_nids)-1)/sizeof(rsaref_cipher_nids[0]);
		}
	/* We are being asked for a specific cipher */
	switch (nid)
		{
	case NID_des_cbc:
		*cipher = &cipher_des_cbc; break;
	case NID_des_ede3_cbc:
		*cipher = &cipher_des_ede3_cbc; break;
	case NID_desx_cbc:
		*cipher = &cipher_desx_cbc; break;
	default:
		ok = 0;
		*cipher = NULL;
		break;
		}
	return ok;
	}
static int rsaref_digests(ENGINE *e, const EVP_MD **digest,
	const int **nids, int nid)
	{
	int ok = 1;
	if(!digest)
		{
		/* We are returning a list of supported nids */
		*nids = rsaref_digest_nids;
		return (sizeof(rsaref_digest_nids)-1)/sizeof(rsaref_digest_nids[0]);
		}
	/* We are being asked for a specific digest */
	switch (nid)
		{
	case NID_md2:
		*digest = &digest_md2; break;
	case NID_md5:
		*digest = &digest_md5; break;
	default:
		ok = 0;
		*digest = NULL;
		break;
		}
	return ok;
	}

/*****************************************************************************
 * DES functions
 **/
#undef data
#define data(ctx) ((DES_CBC_CTX *)(ctx)->cipher_data)
static int cipher_des_cbc_init(EVP_CIPHER_CTX *ctx, const unsigned char *key,
	const unsigned char *iv, int enc)
	{
	DES_CBCInit(data(ctx), (unsigned char *)key, (unsigned char *)iv, enc);
	return 1;
	}
static int cipher_des_cbc_code(EVP_CIPHER_CTX *ctx, unsigned char *out,
	const unsigned char *in, unsigned int inl)
	{
	int ret = DES_CBCUpdate(data(ctx), out, (unsigned char *)in, inl);
	switch (ret)
		{
	case RE_LEN:
		RSAREFerr(RSAREF_F_CIPHER_DES_CBC_CODE,RSAREF_R_LENGTH_NOT_BLOCK_ALIGNED);
		break;
	case 0:
		break;
	default:
		RSAREFerr(RSAREF_F_CIPHER_DES_CBC_CODE,RSAREF_R_UNKNOWN_FAULT);
		}
	return !ret;
	}
static int cipher_des_cbc_clean(EVP_CIPHER_CTX *ctx)
	{
	memset(data(ctx), 0, ctx->cipher->ctx_size);
	return 1;
	}

#undef data
#define data(ctx) ((DES3_CBC_CTX *)(ctx)->cipher_data)
static int cipher_des_ede3_cbc_init(EVP_CIPHER_CTX *ctx, const unsigned char *key,
	const unsigned char *iv, int enc)
	{
	DES3_CBCInit(data(ctx), (unsigned char *)key, (unsigned char *)iv,
		enc);
	return 1;
	}
static int cipher_des_ede3_cbc_code(EVP_CIPHER_CTX *ctx, unsigned char *out,
	const unsigned char *in, unsigned int inl)
	{
	int ret = DES3_CBCUpdate(data(ctx), out, (unsigned char *)in, inl);
	switch (ret)
		{
	case RE_LEN:
		RSAREFerr(RSAREF_F_CIPHER_DES_CBC_CODE,RSAREF_R_LENGTH_NOT_BLOCK_ALIGNED);
		break;
	case 0:
		break;
	default:
		RSAREFerr(RSAREF_F_CIPHER_DES_CBC_CODE,RSAREF_R_UNKNOWN_FAULT);
		}
	return !ret;
	}
static int cipher_des_ede3_cbc_clean(EVP_CIPHER_CTX *ctx)
	{
	memset(data(ctx), 0, ctx->cipher->ctx_size);
	return 1;
	}

#undef data
#define data(ctx) ((DESX_CBC_CTX *)(ctx)->cipher_data)
static int cipher_desx_cbc_init(EVP_CIPHER_CTX *ctx, const unsigned char *key,
	const unsigned char *iv, int enc)
	{
	DESX_CBCInit(data(ctx), (unsigned char *)key, (unsigned char *)iv,
		enc);
	return 1;
	}
static int cipher_desx_cbc_code(EVP_CIPHER_CTX *ctx, unsigned char *out,
	const unsigned char *in, unsigned int inl)
	{
	int ret = DESX_CBCUpdate(data(ctx), out, (unsigned char *)in, inl);
	switch (ret)
		{
	case RE_LEN:
		RSAREFerr(RSAREF_F_CIPHER_DES_CBC_CODE,RSAREF_R_LENGTH_NOT_BLOCK_ALIGNED);
		break;
	case 0:
		break;
	default:
		RSAREFerr(RSAREF_F_CIPHER_DES_CBC_CODE,RSAREF_R_UNKNOWN_FAULT);
		}
	return !ret;
	}
static int cipher_desx_cbc_clean(EVP_CIPHER_CTX *ctx)
	{
	memset(data(ctx), 0, ctx->cipher->ctx_size);
	return 1;
	}

/*****************************************************************************
 * MD functions
 **/
#undef data
#define data(ctx) ((MD2_CTX *)(ctx)->md_data)
static int digest_md2_init(EVP_MD_CTX *ctx)
	{
	MD2Init(data(ctx));
	return 1;
	}
static int digest_md2_update(EVP_MD_CTX *ctx,const void *data,
	unsigned long count)
	{
	MD2Update(data(ctx), (unsigned char *)data, (unsigned int)count);
	return 1;
	}
static int digest_md2_final(EVP_MD_CTX *ctx,unsigned char *md)
	{
	MD2Final(md, data(ctx));
	return 1;
	}

#undef data
#define data(ctx) ((MD5_CTX *)(ctx)->md_data)
static int digest_md5_init(EVP_MD_CTX *ctx)
	{
	MD5Init(data(ctx));
	return 1;
	}
static int digest_md5_update(EVP_MD_CTX *ctx,const void *data,
	unsigned long count)
	{
	MD5Update(data(ctx), (unsigned char *)data, (unsigned int)count);
	return 1;
	}
static int digest_md5_final(EVP_MD_CTX *ctx,unsigned char *md)
	{
	MD5Final(md, data(ctx));
	return 1;
	}


text:
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**count** | **NSNumber*** |  | [optional]
**data** | [**ACExportDataArray***](ACExportDataArray.md) |  | [optional]
**offset** | **NSNumber*** |  | [optional]
**total** | **NSNumber*** |  | [optional]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


text:
/*
 * Work around the class() function in AIX math.h clashing with
 * identifiers named "class".
 *
 * This file is part of FFmpeg.
 *
 * FFmpeg is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * FFmpeg is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with FFmpeg; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 */

#ifndef COMPAT_AIX_MATH_H
#define COMPAT_AIX_MATH_H

#define class class_in_math_h_causes_problems

#include_next <math.h>

#undef class

#endif /* COMPAT_AIX_MATH_H */


text:
This Google Cast demo application shows how to send messages from an Android device to a receiver using a custom namespace.

## Dependencies
* The Android SDK android-support-v7-appcompat and android-support-v7-mediarouter support libraries (at least revision 19).
* The Android SDK google-play-services_lib library (at least version 4.2)

## Setup Instructions
* Just check out the code from GitHub and run the app on your mobile device
* If you don't want to use the sample App ID, you need to do the following steps
* Get a Chromecast device and get it set up for development: https://developers.google.com/cast/docs/developers#Get_started
* Register an application on the Developers Console (http://cast.google.com/publish). Select the Custom Receiver option and specify the URL to where you are hosting the receiver/receiver.html file (You can use Google Drive to host your files: https://support.google.com/drive/answer/2881970?hl=en). You will get an App ID when you finish registering your application.
* Setup the project dependencies
* Insert your App ID in the strings.xml in the res directory of the project (look for app_id in that file)
* Compile and deploy to your Android device.

## References and How to report bugs
* Cast APIs: http://developers.google.com/cast/
* Design Checklist (http://developers.google.com/cast/docs/design_checklist)
* If you find any issues, please open a bug here on GitHub

## How to make contributions?
Please read and follow the steps in the CONTRIBUTING.md

## License
See LICENSE

## Terms
Your use of this sample is subject to, and by using or downloading the sample files you agree to comply with, the [Google APIs Terms of Service](https://developers.google.com/terms/) and the [Google Cast SDK Additional Developer Terms of Service](https://developers.google.com/cast/docs/terms/).

## Google+
Google Cast Developers Community on Google+ [http://goo.gl/TPLDxj](http://goo.gl/TPLDxj)