text:
/**
 *
 *
 * @class doc_use_of_model
 *
 * @par
 * When a Model object is provided, identifiers (values of type @c SId)
 * from that model are used in preference to pre-defined MathML symbol
 * definitions.  More precisely, the Model entities whose identifiers will
 * shadow identical symbols in the mathematical formula are: Species,
 * Compartment, Parameter, Reaction, and SpeciesReference.  For instance, if
 * the parser is given a Model containing a Species with the identifier
 * "pi", and the formula to be parsed is
 * "3*pi", the MathML produced will contain the
 * construct <ci> pi </ci> instead of the construct
 * <pi/>.  Similarly, when a Model object is provided, @c
 * SId values of user-defined functions present in the Model will be used
 * preferentially over pre-defined MathML functions.  For example, if the
 * passed-in Model contains a FunctionDefinition with the identifier
 * "sin", that function will be used instead of the
 * predefined MathML function <sin/>.
 *
 * @class doc_unary_minus_settings
 *
 * @par
 * This setting affects two behaviors.  First, pairs of multiple unary
 * minuses in a row (e.g., "- -3") can be collapsed
 * and ignored in the input, or the multiple minuses can be preserved in the
 * AST node tree that is generated by the parser.  Second, minus signs in
 * front of numbers can be collapsed into the number node itself; for
 * example, a "- 4.1" can be turned into a single
 * ASTNode of type @sbmlconstant{AST_REAL,ASTNodeType_t} with a value of
 * -4.1, or it can be turned into a node of type
 * @sbmlconstant{AST_MINUS,ASTNodeType_t} having a child node of type
 * @sbmlconstant{AST_REAL,ASTNodeType_t}.
 *
 * @class doc_unary_minus_values
 *
 *

 *
 @sbmlconstant{L3P_COLLAPSE_UNARY_MINUS,} (value = @c true): collapse
 * unary minuses where possible.
 *
 @sbmlconstant{L3P_EXPAND_UNARY_MINUS,} (value = @c false): do not
 * collapse unary minuses, and instead translate each one into an AST node of
 * type @sbmlconstant{AST_MINUS,ASTNodeType_t}.
 *

 *
 * @class doc_parsing_units
 *
 * @par
 * In SBML Level 2, there is no means of associating a unit of
 * measurement with a pure number in a formula, while SBML Level 3 does
 * define a syntax for this.  In Level 3, MathML <cn>
 * elements can have an attribute named @c units placed in the SBML
 * namespace, which can be used to indicate the units to be associated with
 * the number.  The text-string infix formula parser allows units to be
 * placed after raw numbers; they are interpreted as unit identifiers for
 * units defined by the SBML specification or in the containing Model object.
 * Some examples include: "4 mL", "2.01
 * Hz", "3.1e-6 M", and "(5/8)
 * inches".  To produce a valid SBML model, there must either
 * exist a UnitDefinition corresponding to the identifier of the unit, or the
 * unit must be defined in Table 2 of the SBML Level 3 specification.
 *
 * @class doc_parsing_units_values
 *
 *

 *
 @sbmlconstant{L3P_PARSE_UNITS,} (value = @c true): parse units in the
 * text-string formula.
 *
 @sbmlconstant{L3P_NO_UNITS,} (value = @c false): treat units in the
 * text-string formula as errors.
 *

 *
 * @class doc_parsing_avogadro
 *
 * @par
 * SBML Level 3 defines a symbol for representing the value of
 * Avogadro's constant, but it is not defined in SBML Level 2.  As a
 * result, the text-string formula parser must behave differently
 * depending on which SBML Level is being targeted.  For Level 3
 * documents, it can interpret instances of @c avogadro in the input
 * as a reference to the MathML @em csymbol for Avogadro's constant
 * defined in the SBML Level 3 specification.  For Level 2,
 * it must treat @c avogadro as just another plain symbol.
 *
 * @class doc_avogadro_values
 *
 *

 *
 @sbmlconstant{L3P_AVOGADRO_IS_CSYMBOL,} (value = @c true): tells the
 * parser to translate the string @c avogadro (in any capitalization) into an
 * AST node of type @sbmlconstant{AST_NAME_AVOGADRO,ASTNodeType_t}.
 *
 @sbmlconstant{L3P_AVOGADRO_IS_NAME,} (value = @c false): tells the
 * parser to translate the string @c avogadro into an AST of type
 * @sbmlconstant{AST_NAME,ASTNodeType_t}.
 *

 *
 * @class doc_case_sensitivity
 *
 * @par
 * By default (which is the value
 * @sbmlconstant{L3P_COMPARE_BUILTINS_CASE_INSENSITIVE,}), the parser
 * compares symbols in a case @em insensitive manner for built-in functions
 * such as @c "sin" and @c "piecewise", and for constants such as @c "true"
 * and @c "avogadro".  Setting this option to
 * @sbmlconstant{L3P_COMPARE_BUILTINS_CASE_SENSITIVE,} causes the parser to
 * become case sensitive.  In that mode, for example, the symbols @c "sin"
 * and @c "true" will match the built-in values, but the symbols @c "SIN",
 * @c "Sin", @c "True", @c "TRUE", and so on, will not.
 */

#ifndef L3ParserSettings_h
#define L3ParserSettings_h

#include <sbml/common/libsbml-namespace.h>
#include <sbml/common/extern.h>
#include <sbml/common/sbmlfwd.h>
#include <sbml/util/StringBuffer.h>

/**
 * @enum ParseLogType_t
 * @brief Configuration values for handling the @c log function in
 * mathematical formulas.
 *
 * The L3ParserSettings object can be used to modify the behavior of the SBML
 * Level 3-oriented formula parser.  One of the behaviors that can be
 * modified is how it should translate the function log(x).  It
 * has three different behavior modes, each settable using values from this
 * enumeration.
 *
 * @see L3ParserSettings
 * @see @sbmlfunction{parseL3FormulaWithSettings, String\, L3ParserSettings}
 * @see @sbmlfunction{formulaToL3StringWithSettings, ASTNode\, L3ParserSettings}
 */
typedef enum
{
    L3P_PARSE_LOG_AS_LOG10 = 0,
    /*!< Parse log(x) as the base-10 logarithm of @c x. */

    L3P_PARSE_LOG_AS_LN    = 1,
    /*!< Parse log(x) as the natural logarithm of @c x. */

    L3P_PARSE_LOG_AS_ERROR = 2
    /*!< Refuse to parse log(x) at all, and set an error message
      telling the user to use log10(x), ln(x),
      or log(base, x) instead. */

} ParseLogType_t;

/**
 * Collapse unary minuses where possible.
 *
 * @see L3ParserSettings::getParseCollapseMinus()
 * @see L3ParserSettings::setParseCollapseMinus()
 */
#define L3P_COLLAPSE_UNARY_MINUS true

/**
 * Retain unary minuses in the AST representation.
 *
 * @see L3ParserSettings::getParseCollapseMinus()
 * @see L3ParserSettings::setParseCollapseMinus()
 */
#define L3P_EXPAND_UNARY_MINUS   false

/**
 * Parse units in text-string formulas.
 *
 * @see L3ParserSettings::getParseUnits()
 * @see L3ParserSettings::setParseUnits()
 */
#define L3P_PARSE_UNITS  true

/**
 * Do not recognize units in text-string formulas---treat them as errors.
 *
 * @see L3ParserSettings::getParseUnits()
 * @see L3ParserSettings::setParseUnits()
 */
#define L3P_NO_UNITS false

/**
 * Recognize 'avogadro' as an SBML Level 3 symbol.
 *
 * @see L3ParserSettings::getParseAvogadroCsymbol()
 * @see L3ParserSettings::setParseAvogadroCsymbol()
 */
#define L3P_AVOGADRO_IS_CSYMBOL true

/**
 * Do not treat 'avogadro' specially---consider it a plain symbol name.
 *
 * @see L3ParserSettings::getParseAvogadroCsymbol()
 * @see L3ParserSettings::setParseAvogadroCsymbol()
 */
#define L3P_AVOGADRO_IS_NAME    false

/**
 * Treat all forms of built-in functions as referencing that function,
 * regardless of the capitalization of that string.
 *
 * @see L3ParserSettings::getComparisonCaseSensitivity()
 * @see L3ParserSettings::setComparisonCaseSensitivity()
 */
#define L3P_COMPARE_BUILTINS_CASE_INSENSITIVE false

/**
 * Treat only the all-lower-case form of built-in functions as referencing
 * that function, and all other forms of capitalization of that string
 * as referencing user-defined functions or values.
 *
 * @see L3ParserSettings::getComparisonCaseSensitivity()
 * @see L3ParserSettings::setComparisonCaseSensitivity()
 */
#define L3P_COMPARE_BUILTINS_CASE_SENSITIVE true

typedef enum
{
    INFIX_SYNTAX_NAMED_SQUARE_BRACKETS
  , INFIX_SYNTAX_CURLY_BRACES
  , INFIX_SYNTAX_CURLY_BRACES_SEMICOLON
} L3ParserGrammarLineType_t;

#ifdef __cplusplus

#include <vector>
#include <string>

LIBSBML_CPP_NAMESPACE_BEGIN

class Model;
class L3Parser;

#ifndef LIBSBML_USE_LEGACY_MATH
class ASTBasePlugin;
#endif

class LIBSBML_EXTERN L3ParserSettings
{
private:
  /** @cond doxygenLibsbmlInternal */
  const Model* mModel;
  ParseLogType_t mParselog;
  bool mCollapseminus;
  bool mParseunits;
  bool mAvoCsymbol;
  bool mStrCmpIsCaseSensitive;
#ifndef LIBSBML_USE_LEGACY_MATH
  std::vector<ASTBasePlugin*> mPlugins;
#endif
  /** @endcond */

public:

  /**
   * Creates a new L3ParserSettings object with default values.
   *
   * This is the default constructor for the L3ParserSettings object.  It
   * sets the stored Model object to @c NULL and sets the following
   * field values in the L3ParserSettings object:
   *
   * @li parseunits ("parse units") is set to
   * @sbmlconstant{L3P_PARSE_UNITS,}.
   *
   * @li collapseminus ("collapse minus") is set to
   * @sbmlconstant{L3P_EXPAND_UNARY_MINUS,}.
   *
   * @li parselog ("parse log") is set to
   * @sbmlconstant{L3P_PARSE_LOG_AS_LOG10,ParseLogType_t}.
   *
   * @li avocsymbol ("Avogadro csymbol") is set to
   * @sbmlconstant{L3P_AVOGADRO_IS_CSYMBOL,}.
   *
   * @li caseSensitive ("case sensitive") is set to
   * @sbmlconstant{L3P_COMPARE_BUILTINS_CASE_INSENSITIVE,}.
   *
   * @li sbmlns ("SBML namespaces") is set to @c NULL (which
   * indicates that no syntax extensions due to SBML Level 3 packages
   * will be assumed---the formula parser will only understand the
   * core syntax described in the documentation for
   * @sbmlfunction{parseL3Formula, String}).
   */
  L3ParserSettings();

  /**
   * Creates a new L3ParserSettings object with specific values for all
   * possible settings.
   *
   * @param model a Model object to be used for disambiguating identifiers
   * encountered by @sbmlfunction{parseL3FormulaWithSettings, String\,
   * L3ParserSettings} in mathematical formulas.
   *
   * @param parselog ("parse log") a flag that controls how the parser will
   * handle the symbol @c log in mathematical formulas. The function @c log
   * with a single argument ("log(x)") can be parsed
   * as log10(x), ln(x), or treated as an error, as
   * desired, by using the parameter values
   * @sbmlconstant{L3P_PARSE_LOG_AS_LOG10,ParseLogType_t},
   * @sbmlconstant{L3P_PARSE_LOG_AS_LN,ParseLogType_t}, or
   * @sbmlconstant{L3P_PARSE_LOG_AS_ERROR,ParseLogType_t}, respectively.
   *
   * @param collapseminus ("collapse minus") a flag that controls how the
   * parser will handle minus signs in formulas.  Unary minus signs can be
   * collapsed or preserved; that is, sequential pairs of unary minuses
   * (e.g., "- -3") can be removed from the input
   * entirely and single unary minuses can be incorporated into the number
   * node, or all minuses can be preserved in the AST node structure.
   * The possible values of this field are
   * @sbmlconstant{L3P_COLLAPSE_UNARY_MINUS,} (to collapse unary minuses) and
   * @sbmlconstant{L3P_EXPAND_UNARY_MINUS,} (to expand unary minuses).
   *
   * @param parseunits ("parse units") a flag that controls how the parser
   * will handle apparent references to units of measurement associated with
   * raw numbers in a formula.  If set to the value
   * @sbmlconstant{L3P_PARSE_UNITS,}, units are parsed; if set to the value
   * @sbmlconstant{L3P_NO_UNITS,}, units are not parsed.
   *
   * @param avocsymbol ("Avogadro csymbol") a flag that controls how the
   * parser will handle the appearance of the symbol @c avogadro in a
   * formula.  If set to the value @sbmlconstant{L3P_AVOGADRO_IS_CSYMBOL,},
   * the symbol is interpreted as the SBML/MathML @em csymbol @c avogadro; if
   * set to the value @sbmlconstant{L3P_AVOGADRO_IS_NAME,}, the symbol is
   * interpreted as a plain symbol name.
   *
   * @param caseSensitive ("case sensitive") a flag that controls how the
   * cases of alphabetical characters are treated when symbols are compared.
   * If the flag is set to the value
   * @sbmlconstant{L3P_COMPARE_BUILTINS_CASE_INSENSITIVE,}, symbols are
   * compared in a case-insensitive manner, which means that mathematical
   * functions such as @c "sin" will be matched no matter what their case is:
   * @c "Sin", @c "SIN", etc.  If the flag is set to the value
   * @sbmlconstant{L3P_COMPARE_BUILTINS_CASE_SENSITIVE,}, symbols are
   * interpreted in a case-sensitive manner.
   *
   * @param sbmlns ("SBML namespaces") an SBML namespaces object.  The
   * namespaces identify the SBML Level 3 packages that can extend the
   * syntax understood by the formula parser.  When non-@c NULL, the parser
   * will interpret additional syntax defined by the packages; for example,
   * it may understand vector/array extensions introduced by the SBML
   * Level 3 @em Arrays package.
   *
   * @ifnot hasDefaultArgs @htmlinclude warn-default-args-in-docs.html @endif@~
   *
   * @see getModel()
   * @see setModel(@if java Model@endif)
   * @see unsetModel()
   * @see getParseLog()
   * @see setParseLog(@if java int@endif)
   * @see getParseUnits()
   * @see setParseUnits(@if java boolean@endif)
   * @see getParseCollapseMinus()
   * @see setParseCollapseMinus(@if java boolean@endif)
   * @see getParseAvogadroCsymbol()
   * @see setParseAvogadroCsymbol(@if java boolean@endif)
   */
  L3ParserSettings(Model* model, ParseLogType_t parselog,
                   bool collapseminus, bool parseunits, bool avocsymbol,
                   bool caseSensitive = false,
                   SBMLNamespaces* sbmlns = NULL);

  /**
   * Copy constructor.
   */
   L3ParserSettings(const L3ParserSettings& source);

  /**
   * Assignment operator.
   */
   L3ParserSettings& operator=(const L3ParserSettings& source);

  /**
   * Destroys this L3ParserSettings object.
   */
  virtual ~L3ParserSettings();

  /**
   * Sets the model reference in this L3ParserSettings object.
   *
   * @copydetails doc_use_of_model
   *
   * @param model a Model object to be used for disambiguating identifiers.
   *
   * @warning This does @em not copy the Model object.
   * This means that modifications made to the Model after invoking this
   * method may affect parsing behavior, because the parser will query the
   * @em current contents of the model.
   *
   * @see getModel()
   * @see unsetModel()
   */
  void setModel(const Model* model);

  /**
   * Returns the Model object referenced by this L3ParserSettings object.
   *
   * @copydetails doc_use_of_model
   *
   * @see setModel(@if java Model@endif)
   * @see unsetModel()
   */
  const Model* getModel() const;

  /**
   * Unsets the Model reference in this L3ParserSettings object.
   *
   * The effect of calling this method is to set the stored model value
   * to @c NULL.
   *
   * @see setModel(@if java Model@endif)
   * @see getModel()
   */
  void unsetModel();

  /**
   * Sets the behavior for handling @c log in mathematical formulas.
   *
   * The function @c log with a single argument
   * ("log(x)") can be parsed as
   * log10(x), ln(x), or treated as an error.
   * These three behaviors are set, respectively, by using the value
   * @sbmlconstant{L3P_PARSE_LOG_AS_LOG10,ParseLogType_t},
   * @sbmlconstant{L3P_PARSE_LOG_AS_LN,ParseLogType_t}, or
   * @sbmlconstant{L3P_PARSE_LOG_AS_ERROR,ParseLogType_t}
   * for the @p type parameter.
   *
   * @param type a constant, one of following three possibilities:
   * @li @sbmlconstant{L3P_PARSE_LOG_AS_LOG10,ParseLogType_t}
   * @li @sbmlconstant{L3P_PARSE_LOG_AS_LN,ParseLogType_t}
   * @li @sbmlconstant{L3P_PARSE_LOG_AS_ERROR,ParseLogType_t}
   *
   * @see getParseLog()
   */
  void setParseLog(ParseLogType_t type);

  /**
   * Indicates the current behavior set for handling the function @c log with
   * one argument.
   *
   * The function @c log with a single argument
   * ("log(x)") can be parsed as
   * log10(x), ln(x), or treated as an error, as
   * desired.  These three possible behaviors are indicated, respectively, by
   * the values
   * @sbmlconstant{L3P_PARSE_LOG_AS_LOG10,ParseLogType_t},
   * @sbmlconstant{L3P_PARSE_LOG_AS_LN,ParseLogType_t}, and
   * @sbmlconstant{L3P_PARSE_LOG_AS_ERROR,ParseLogType_t}.
   *
   * @return One of following three constants:
   * @li @sbmlconstant{L3P_PARSE_LOG_AS_LOG10,ParseLogType_t}
   * @li @sbmlconstant{L3P_PARSE_LOG_AS_LN,ParseLogType_t}
   * @li @sbmlconstant{L3P_PARSE_LOG_AS_ERROR,ParseLogType_t}
   *
   * @see setParseLog(@if java int@endif)
   */
  ParseLogType_t getParseLog() const;

  /**
   * Sets the behavior for handling unary minuses appearing in mathematical
   * formulas.
   *
   * @copydetails doc_unary_minus_settings
   *
   * This method lets you tell the parser which behavior to use---either
   * collapse minuses or always preserve them.  The two possibilities are
   * represented using the following constants:
   *
   * @copydetails doc_unary_minus_values
   *
   * @param collapseminus a boolean value (one of the constants
   * @sbmlconstant{L3P_COLLAPSE_UNARY_MINUS,} or
   * @sbmlconstant{L3P_EXPAND_UNARY_MINUS,})
   * indicating how unary minus signs in the input should be handled.
   *
   * @see getParseCollapseMinus()
   */
  void setParseCollapseMinus(bool collapseminus);

  /**
   * Indicates the current behavior set for handling multiple unary minuses
   * in formulas.
   *
   * @copydetails doc_unary_minus_settings
   *
   * @return A boolean indicating the behavior currently set.  The possible
   * values are as follows:
   * @copydetails doc_unary_minus_values
   *
   * @see setParseCollapseMinus(@if java boolean@endif)
   */
  bool getParseCollapseMinus() const;

  /**
   * Sets the parser's behavior in handling units associated with numbers
   * in a mathematical formula.
   *
   * @copydetails doc_parsing_units
   *
   * This method sets the formula parser's behavior with respect to units.
   *
   * @param units A boolean indicating whether to parse units.  The
   * possible values are as follows:
   * @copydetails doc_parsing_units_values
   *
   * @see getParseUnits()
   */
  void setParseUnits(bool units);

  /**
   * Indicates the current behavior set for handling units in text-string
   * mathematical formulas.
   *
   * @copydetails doc_parsing_units
   *
   * Since SBML Level 2 does not have the ability to associate units
   * with pure numbers, the value should be expected to be @c false
   * (@sbmlconstant{L3P_NO_UNITS,}) when parsing text-string
   * formulas intended for use in SBML Level 2 documents.
   *
   * @return A boolean indicating whether to parse units.  The
   * possible values are as follows:
   * @copydetails doc_parsing_units_values
   *
   * @see setParseUnits(@if java boolean@endif)
   */
  bool getParseUnits() const;

  /**
   * Sets the parser's behavior in handling the symbol @c avogadro in
   * mathematical formulas.
   *
   * @copydetails doc_parsing_avogadro
   *
   * This method allows callers to set the avogadro-handling
   * behavior in this L3ParserSettings object.  The possible values of @p
   * l2only are as follows:
   *
   * @copydetails doc_avogadro_values
   *
   * Since SBML Level 2 does not define a symbol for Avogadro's
   * constant, the value should be set to
   * @sbmlconstant{L3P_AVOGADRO_IS_NAME,} when parsing text-string formulas
   * intended for use in SBML Level 2 documents.
   *
   * @param l2only a boolean value indicating how the string @c avogadro
   * should be treated when encountered in a formula.  This will be one of
   * the values @sbmlconstant{L3P_AVOGADRO_IS_CSYMBOL,} or
   * @sbmlconstant{L3P_AVOGADRO_IS_NAME,}.
   *
   * @see getParseAvogadroCsymbol()
   */
  void setParseAvogadroCsymbol(bool l2only);

  /**
   * Indicates the current behavior set for handling @c avogadro for SBML
   * Level 3.
   *
   * @copydetails doc_parsing_avogadro
   *
   * This method returns the current setting of the
   * avogadro-handling behavior in this L3ParserSettings object.
   * The possible values are as follows:
   *
   * @copydetails doc_avogadro_values
   *
   * @return A boolean indicating which mode is currently set; one of
   * @sbmlconstant{L3P_AVOGADRO_IS_CSYMBOL,}
   * or
   * @sbmlconstant{L3P_AVOGADRO_IS_NAME,}.
   *
   * @see setParseAvogadroCsymbol(@if java boolean@endif)
   */
  bool getParseAvogadroCsymbol() const;

  /**
   * Sets the parser's behavior with respect to case sensitivity for
   * recognizing predefined symbols.
   *
   * @copydetails doc_case_sensitivity
   *
   * @param strcmp a boolean indicating whether to be case sensitive (if @c
   * true) or be case insensitive (if @c false).
   *
   * @see getComparisonCaseSensitivity()
   */
  void setComparisonCaseSensitivity(bool strcmp);

  /**
   * Returns @c true if the parser is configured to match built-in symbols
   * in a case-insensitive way.
   *
   * @copydetails doc_case_sensitivity
   *
   * @return @c true if matches are done in a case-sensitive manner, and
   * @c false if the parser will recognize built-in functions and
   * constants regardless of case,.
   *
   * @see setComparisonCaseSensitivity(@if java boolean@endif)
   */
  bool getComparisonCaseSensitivity() const;

  /**
   * Set up the plugins for this L3ParserSettings, based on the
   * SBMLNamespaces object.
   *
   * When a SBMLNamespaces object is provided, the parser will only interpret
   * infix syntax understood by the core libSBML @em plus the packages
   * indicated by the SBMLNamespaces objects provided.  ASTNode objects
   * returned by the L3Parser will contain those SBMLNamespaces objects, and
   * will be used to parse certain constructs that may only be understood by
   * packages (e.g., vectors for the SBML Level 3 "arrays" package).
   * Note that by default, all packages that were compiled with this version
   * of libSBML are included, so this function is most useful as a way to
   * turn @em off certain namespaces, such as might be desired if your tool
   * does not support vectors, for example.
   *
   * @param sbmlns a SBMLNamespaces object to be used.  If @c NULL is given
   * as the value, all plugins will be loaded.
   */
  void setPlugins(const SBMLNamespaces * sbmlns);

  /** @cond doxygenLibsbmlInternal */
  /**
   * Visits the given ASTNode_t and continues the inorder traversal for nodes
   * whose syntax are determined by packages.
   */
  void visitPackageInfixSyntax ( const ASTNode_t *parent,
                            const ASTNode_t *node,
                            StringBuffer_t  *sb) const;
  /** @endcond */

  /** @cond doxygenLibsbmlInternal */
  friend class L3Parser;
  /** @endcond */

private:
  /** @cond doxygenLibsbmlInternal */
  /**
   * This function checks the provided ASTNode function to see if it is a
   * known function with the wrong number of arguments.  If so, the error is
   * set and 'true' is returned.  If the correct number of arguments is
   * provided, 'false' is returned.  It is used for ASTNodes created from
   * packages.
   */
  bool checkNumArgumentsForPackage(const ASTNode* function,
                                   std::stringstream& error) const;

  /**
   * The generic parsing function for grammar lines that packages recognize,
   * but not core.  When a package recognizes the 'type', it will parse and
   * return the correct ASTNode.  If it does not recognize the 'type', or if
   * the arguments are incorrect, NULL is returned.
   */
  virtual ASTNode* parsePackageInfix(L3ParserGrammarLineType_t type,
                                     std::vector<ASTNode*> *nodeList = NULL,
                                     std::vector<std::string*> *stringList = NULL,
                                     std::vector<double> *doubleList = NULL) const;

  /**
   * The user input a string of the form "name(...)", and we want to know if
   * 'name' is recognized by a package as being a particular function.  We
   * already know that it is not used in the Model as a FunctionDefinition.
   * Should do caseless string comparison.  Return the type of the function,
   * or AST_UNKNOWN if nothing found.
   */
  int getPackageFunctionFor(const std::string& name) const;

  /**
   * Delete the plugin objects.
   */
  void deletePlugins();

  /** @endcond */
};

LIBSBML_CPP_NAMESPACE_END

#endif  /* __cplusplus */

#ifndef SWIG

LIBSBML_CPP_NAMESPACE_BEGIN
BEGIN_C_DECLS

/**
 * Creates a new L3ParserSettings_t structure and returns a pointer to it
 *
 * @note This functions sets the Model* to NULL, and other settings to
 * L3P_PARSE_LOG_AS_LOG10, L3P_EXPAND_UNARY_MINUS, L3P_PARSE_UNITS,
 * and L3P_AVOGADRO_IS_CSYMBOL.
 *
 * @return a pointer to the newly created L3ParserSettings_t structure.
 *
 * @memberof L3ParserSettings_t
 */
LIBSBML_EXTERN
L3ParserSettings_t *
L3ParserSettings_create ();

/**
 * Frees the given L3ParserSettings_t structure.
 *
 * @param settings the L3ParserSettings_t to free
 *
 * @memberof L3ParserSettings_t
 */
LIBSBML_EXTERN
void
L3ParserSettings_free (L3ParserSettings_t * settings);

/**
 * Sets the model associated with this L3ParserSettings_t structure
 * to the provided pointer.
 *
 * @note A copy of the Model_t is not made, so modifications to the Model_t
 * itself may affect future parsing.
 *
 * @param settings the L3ParserSettings_t structure on which to set the Model_t.
 * @param model The Model_t structure to which infix strings are to be compared.
 *
 * @memberof L3ParserSettings_t
 */
LIBSBML_EXTERN
void
L3ParserSettings_setModel (L3ParserSettings_t * settings, const Model_t * model);

/**
 * Retrieves the model associated with this L3ParserSettings_t structure.
 *
 * @param settings the L3ParserSettings_t structure from which to get the Model_t.
 *
 * @return the Model_t structure associated with this L3ParserSettings_t structure.
 *
 * @memberof L3ParserSettings_t
 */
LIBSBML_EXTERN
const Model_t *
L3ParserSettings_getModel (const L3ParserSettings_t * settings);

/**
 * Unsets the model associated with this L3ParserSettings_t structure.
 *
 * @param settings the L3ParserSettings_t structure on which to unset the Model_t.
 *
 * @memberof L3ParserSettings_t
 */
LIBSBML_EXTERN
void
L3ParserSettings_unsetModel (L3ParserSettings_t * settings);

/**
 * Sets the log parsing option associated with this L3ParserSettings_t structure.
 *
 * This option allows the user to specify how the infix expression 'log(x)'
 * is parsed in a MathML ASTNode. The options are:
 * @li L3P_PARSE_LOG_AS_LOG10 (0)
 * @li L3P_PARSE_LOG_AS_LN (1)
 * @li L3P_PARSE_LOG_AS_ERROR (2)
 *
 * @param settings the L3ParserSettings_t structure on which to set the option.
 * @param type ParseLogType_t log parsing option to associate with this
 * L3ParserSettings_t structure.
 *
 * @memberof L3ParserSettings_t
 */
LIBSBML_EXTERN
void
L3ParserSettings_setParseLog (L3ParserSettings_t * settings, ParseLogType_t type);

/**
 * Retrieves the log parsing option associated with this L3ParserSettings_t structure.
 *
 * This option allows the user to specify how the infix expression 'log(x)'
 * is parsed in a MathML ASTNode. The options are:
 * @li L3P_PARSE_LOG_AS_LOG10 (0)
 * @li L3P_PARSE_LOG_AS_LN (1)
 * @li L3P_PARSE_LOG_AS_ERROR (2)
 *
 * @param settings the L3ParserSettings_t structure on which to set the Model_t.
 *
 * @return ParseLogType_t log parsing option to associate with this
 * L3ParserSettings_t structure.  Returns L3P_PARSE_LOG_AS_LOG10 (0) if @param settings
 * is NULL.
 *
 * @memberof L3ParserSettings_t
 */
LIBSBML_EXTERN
ParseLogType_t
L3ParserSettings_getParseLog (const L3ParserSettings_t * settings);

/**
 * Sets the collapse minus option associated with this L3ParserSettings_t structure.
 *
 * This option allows the user to specify how the infix expression '-4'
 * is parsed in a MathML ASTNode.
 *
 * @param settings the L3ParserSettings_t structure on which to set the option.
 * @param flag an integer indicating whether unary minus should be collapsed
 * (non-zero) or not (zero).
 *
 * @memberof L3ParserSettings_t
 */
LIBSBML_EXTERN
void
L3ParserSettings_setParseCollapseMinus (L3ParserSettings_t * settings, int flag);

/**
 * Retrieves the collapse minus option associated with this L3ParserSettings_t structure.
 *
 * This option allows the user to specify how the infix expression '-4'
 * is parsed in a MathML ASTNode.
 *
 * @param settings the L3ParserSettings_t structure from which to get the option.
 *
 * @return an integer indicating whether unary minus should be collapsed
 * (non-zero) or not (zero).  Returns zero (0) if @param settings
 * is NULL.
 *
 * @memberof L3ParserSettings_t
 */
LIBSBML_EXTERN
int
L3ParserSettings_getParseCollapseMinus (const L3ParserSettings_t * settings);

/**
 * Sets the units option associated with this L3ParserSettings_t structure.
 *
 * @param settings the L3ParserSettings_t structure on which to set the option.
 * @param flag an integer indicating whether numbers should be considered as
 * a having units (non-zero) or not (zero).
 *
 * @memberof L3ParserSettings_t
 */
LIBSBML_EXTERN
void
L3ParserSettings_setParseUnits (L3ParserSettings_t * settings, int flag);

/**
 * Retrieves the units option associated with this L3ParserSettings_t structure.
 *
 * @param settings the L3ParserSettings_t structure from which to get the option.
 *
 * @return an integer indicating whether numbers should be considered as
 * a having units (non-zero) or not (zero).  Returns zero (0) if @param settings
 * is NULL.
 *
 * @memberof L3ParserSettings_t
 */
LIBSBML_EXTERN
int
L3ParserSettings_getParseUnits (const L3ParserSettings_t * settings);

/**
 * Sets the avogadro csymbol option associated with this L3ParserSettings_t structure.
 *
 * @param settings the L3ParserSettings_t structure on which to set the option.
 * @param flag an integer indicating whether avogadro should be considered as
 * a csymbol (non-zero) or not (zero).
 *
 * @memberof L3ParserSettings_t
 */
LIBSBML_EXTERN
void
L3ParserSettings_setParseAvogadroCsymbol (L3ParserSettings_t * settings, int flag);

/**
 * Retrieves the avogadro csymbol option associated with this L3ParserSettings_t structure.
 *
 * @param settings the L3ParserSettings_t structure from which to get the option.
 *
 * @return an integer indicating whether avogadro should be considered as
 * a csymbol (non-zero) or not (zero).  Returns zero (0) if @param settings
 * is NULL.
 *
 * @memberof L3ParserSettings_t
 */
LIBSBML_EXTERN
int
L3ParserSettings_getParseAvogadroCsymbol (const L3ParserSettings_t * settings);

/**
 * Visits the given ASTNode_t and continues the inorder traversal for nodes
 * whose syntax are determined by packages.
 */
void
L3ParserSettings_visitPackageInfixSyntax ( const ASTNode_t *parent,
                                           const ASTNode_t *node,
                                           StringBuffer_t  *sb,
                                           const L3ParserSettings_t *settings );

END_C_DECLS
LIBSBML_CPP_NAMESPACE_END

#endif

#endif /* L3ParserSettings_h */


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>SQLite Release 3.10.0 On 2016-01-06</title>

Small. Fast. Reliable.
Choose any three.

    About
    Documentation
    Download
    License
    Support
    Purchase

    <form name=f method="GET" action="https://www.sqlite.org/search">
      <input id=q name=q type=text
       onfocus="entersearch()" onblur="leavesearch()" style="width:24ex;padding:1px 1ex; border:solid white 1px; font-size:0.9em ; font-style:italic;color:#044a64;" value="Search SQLite Docs...">
      <input type=submit value="Go" style="border:solid white 1px;background-color:#044a64;color:white;font-size:0.9em;padding:0 1ex">
    </form>

SQLite Release 3.10.0 On 2016-01-06

General improvements:

Added support for LIKE, GLOB, and REGEXP operators on virtual tables.

Added the colUsed field to sqlite3_index_info for use by
    the sqlite3_module.xBestIndex method.

Enhance the PRAGMA cache_spill statement to accept a 32-bit integer
    parameter which is the threshold below which cache spilling is prohibited.

On unix, if a symlink to a database file is opened, then the corresponding
    journal files are based on the actual filename, not the symlink name.

Added the "--transaction" option to sqldiff.

Added the sqlite3_db_cacheflush() interface.

Added the sqlite3_strlike() interface.

When using memory-mapped I/O map the database file read-only so that stray pointers
    and/or array overruns in the application cannot accidently modify the database file.

Added the experimental sqlite3_snapshot_get(), sqlite3_snapshot_open(),
    and sqlite3_snapshot_free() interfaces.  These are subject to change or removal in
    a subsequent release.

Enhance the 'utc' modifier in the date and time functions so that it is a no-op if
    the date/time is known to already be in UTC.  (This is not a compatibility break since
    the behavior has long been documented as "undefined" in that case.)

Added the json_group_array() and json_group_object() SQL functions in the
    json extension.

Added the SQLITE_LIKE_DOESNT_MATCH_BLOBS compile-time option.

Many small performance optimizations.

Portability enhancements:

Work around a sign-exension bug in the optimizer of the HP C compiler on HP/UX.
    (details)

Enhancements to the command-line shell:

Added the ".changes ON|OFF" and ".vfsinfo" dot-commands.

Translate between MBCS and UTF8 when
    running in cmd.exe on Windows.

Enhancements to makefiles:

Added the --enable-editline and --enable-static-shell options
    to the various autoconf-generated configure scripts.

Omit all use of "awk" in the makefiles, to make building easier for MSVC users.

Important fixes:

Fix inconsistent integer to floating-point comparison operations that
    could result in a corrupt index if the index is created on a table
    column that contains both large integers and floating point values
    of similar magnitude.  Ticket
    38a97a87a6.

Fix an infinite-loop in the query planner that could occur on
    malformed common table expressions.

Various bug fixes in the sqldiff tool.

Hashes:

SQLITE_SOURCE_ID: "2016-01-06 11:01:07 fd0a50f0797d154fefff724624f00548b5320566"

SHA1 for sqlite3.c: b92ca988ebb6df02ac0c8f866dbf3256740408ac

A complete list of SQLite releases
      in a single page and a chronology are both also available.
      A detailed history of every
      check-in is available at

      SQLite version control site.

redpajama_set_name: RedPajamaGithub


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>Contact</title>

    <link href="css/bootstrap.min.css" rel="stylesheet">

    <link href="css/modern-business.css" rel="stylesheet">

    <link href="font-awesome-4.1.0/css/font-awesome.min.css" rel="stylesheet" type="text/css">

                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                    Toggle navigation

                </button>
                Quality Sounds

                        About

                        Contact

                        Shop

                        FAQ

Contact

Home

Contact

Contact Details

                    3481 Melrose Place
Beverly Hills, CA 90210

                    P: (123) 456-7890

                    E: name@example.com

                    H: Monday - Friday: 9:00 AM to 5:00 PM

Send us a Message

                <form name="sentMessage" id="contactForm" novalidate>

                            Full Name:
                            <input type="text" class="form-control" id="name" required data-validation-required-message="Please enter your name.">

                            Phone Number:
                            <input type="tel" class="form-control" id="phone" required data-validation-required-message="Please enter your phone number.">

                            Email Address:
                            <input type="email" class="form-control" id="email" required data-validation-required-message="Please enter your email address.">

                            Message:
                            <textarea rows="10" cols="100" class="form-control" id="message" required data-validation-required-message="Please enter your message" maxlength="999" style="resize:none"></textarea>

                    <button type="submit" class="btn btn-primary">Send Message</button>
                </form>

Copyright © Quality Sounds 2014


text:
var o1 = {a : 10};
var o2 = { };
o2.__proto__ = o1;
var o3 = { };
o3.__proto__ = o2;

function f(n, x, b) {
  var sum = x.a;
  for (var i = 0; i < n; i++) {
    sum = 1.0 / i;
  }
  return sum;
}
%PrepareFunctionForOptimization(f);

f(10, o3);
f(20, o3);
f(30, o3);
%OptimizeFunctionOnNextCall(f, "concurrent");
f(100000, o3);
// At this point OSR replaces already optimized code.
// Check that it evicts old code from cache.

// This causes all code for f to be lazily deopted.
o2.a = 5;
%PrepareFunctionForOptimization(f);

// If OSR did not evict the old code, it will be installed in f here.
%OptimizeFunctionOnNextCall(f);
f(10, o3);

// The old code is already deoptimized, but f still points to it.
// Disassembling it will crash.
%DisassembleFunction(f);


text:
from flask import render_template, request, redirect, flash, session
from . import main
from ..models import User
from flask.ext.login import login_user, logout_user, login_required
from .. import login_manager

@main.route('/', methods=['POST', 'GET'])
def login_page():
    if request.method == 'GET':
        return render_template('login.html')
    else:
        _username = request.form['username']
        _password = request.form['password']
        print (_username, _password)
        user = User.query.filter_by(user_name = _username).first()

        if user is not None and user.verify_password(_password):
            login_user(user)
            session['username'] = user.user_name
            session['role_id'] = user.role_id
            print(session)
            # return redirect('/Dashboard')
            return redirect(request.args.get('next') or '/Dashboard')

        flash('Invalid username or password.')
        return render_template('login.html')

@login_manager.unauthorized_handler
def unauthorized_handler():
    # return 'Unauthorized: You have no access to this page.'
    return render_template('Errors/unauthorized.html')

@main.route('/logout')
def logout():
    logout_user()
    return redirect('/')

@main.route('/Dashboard')
@login_required
def dashboard():
    return render_template('Dashboard.html', user_name = session.get('username'))


text:
var UberClass    = require('uberclass')
  , EventEmitter = require('events').EventEmitter
  , Prototype    = Object.create(EventEmitter.prototype)
  , Static       = Object.create(EventEmitter.prototype)
  , Class;

/**
 * Extends a class with new static and prototype functions, there are a variety of ways to use extend.
 *   // with static and prototype
 *   Class.extend({ STATIC },{ PROTOTYPE })
 *
 *   // with just classname and prototype functions
 *   Class.extend({ PROTOTYPE })
 *
 * @function Class.extend
 * @param  {Object} Static the new classes static properties/functions
 * @param  {Object} Proto  the new classes prototype properties/functions
 * @return {Class}
 */
Static.extend = function(Static, Proto) {
  Static = typeof Proto !== undefined ? Static : {};
  EventEmitter.call(Static);
  var Klss = this._super ? this._super.apply(this, arguments) : arguments;
  Klss.setMaxListeners(0);

  /**
   * extend event.
   *
   * @event Class.extend
   * @type {Class}
   */
  Klss.emit('extend', Klss);

  return Klss;
};

/**
 * Emit an event of a specific type.  This will notify (invoke) each of the
 * listeners in order with any the given arguments.
 *
 * @function Class.emit
 * @param {String} type The type of event to emit
 * @param args Any additional arguments that should be passed to the listeners
 * @example
 * Class.emit('init');
 */

/**
 * Add a listener to this event emitter.  The listener will be called back
 * the next time someone emits an event of the type specified by the
 * type parameter.
 *
 * @function Class.on
 * @param {String} type the type of events the listener is interested in
 * @param {Function} listener the callback function that will be invoked when the event is emitted
 * @param {Boolean} {once=false} true if the listener should only
 *    be notified for the first event, false if the listener should
 *    be notified for all events.
 * @example
 * Class.on('init', function() {
 *   // will be called everytime the "init" event is fired/emitted
 * });
 */

/**
 * Adds a one time listener for the Event. This listener is
 * invoked only the next time the event is fired, after which it is removed.
 *
 * @function Class.once
 * @param {String} type - type of the listener.
 * @param {Function} listener - the listener
 * @example
 * Class.once('init', function() {
 *   // will be called only for the first time the "init" event is fired/emitted
 * });
 */

/**
 * Add a listener which will be called back. An alias for the on() function.
 *
 * @function
 * @example Class.addListener
 * Class.addListener('init', function() {
 *   // will be called everytime the "init" event is fired/emitted
 * });
 */

/**
 * Stops a specified listener from receiving further events.
 *
 * @function Class.removeListener
 * @param {String} type type of the listener
 * @param {Function} listener the listener
 * @example
 * Class.removeListener('init', listener);
 */

/**
 * Removes all the listeners that are listening for a specific type
 * of event.  Care should be taken not to disrupt other plug-ins
 * when calling this on shared event emitters that you do not control
 * yourself, for example the ones provided by Content Studio.
 *
 * @function Class.removeAllListeners
 * @param {String} type the type of events that all listeners should be removed.
 * @example
 * Class.removeAllListeners('init');
 */

/**
 * If a setup method is provided, it is called when a new instances is created. It gets
 * passed the same arguments that were given to the Class constructor function, if
 * setup returns an array, those arguments will be used for init.
 *
 * It's important to call the parents super constructor function by using this._super, as this is
 * where the EventEmitter is called.
 *
 * Also something to remember, if you return a closure (even binded or proxied), make sure to grab a reference to this.super because
 * after the execution of the function your in (that returns a closure), this._super is cleared or set to something else.
 *
 * @example
 * var MyClass = Class.extend(
 * {
 *   setup: function(val) {
 *     this.val = val;
 *     return this._super.apply(this, arguments);
 *   }
 * });
 * var myInstance = new MyClass('Awesome');
 *
 * myInstance.val //-> 'Awesome'
 * @exampleend
 *
 * @function Class#setup
 * @return {Array|undefined} If an array is returned, Class#.init is
 * called with those arguments; otherwise, the original arguments are used.
 */
Prototype.setup = function() {
  EventEmitter.call(this);
  this.setMaxListeners(0);

  /**
   * setup event.
   *
   * @event Class#setup
   * @type {object}
   * @property {arguments} args - The arguments passed to Class#setup
   */
  this.emit('setup', {
    args: arguments
  });

  // return this._super ? this._super.apply(this, arguments) : arguments;
};

/**
 * If an init method is provided, it gets called when a new instance
 * is created.  Init gets called after [Class.prototype.setup setup], typically with the
 * same arguments passed to the Class
 * constructor: ( new Class( arguments ... )).
 *
 * Note: Class#setup is able to modify the arguments passed to init.
 *
 * @function Class#init
 * @example
 * var MyClass = Class.extend(
 * {
 *   setup: function(val) {
 *     this.val = val;
 *     return this._super.apply(this, arguments);
 *   }
 * });
 * var myInstance = new MyClass(1);
 *
 * myInstance.val //-> 1
 * @exampleend
 * @function Class#init
 */
Prototype.init = function() {
  /**
   * init event.
   *
   * @event Class#init
   * @type {object}
   * @property {arguments} args - The arguments passed to Class#init
   */
  this.emit('init', {
    args: arguments
  });

  return this._super ? this._super.apply(this, arguments) : this;
};

/**
 * Emit an event of a specific type.  This will notify (invoke) each of the
 * listeners in order with any the given arguments.
 *
 * @function Class#emit
 * @param {String} type The type of event to emit
 * @param args Any additional arguments that should be passed to the listeners
 * @example
 * Class.emit('init');
 */

/**
 * Add a listener to this event emitter.  The listener will be called back
 * the next time someone emits an event of the type specified by the
 * type parameter.
 *
 * @function Class#on
 * @param {String} type the type of events the listener is interested in
 * @param {Function} listener the callback function that will be invoked when the event is emitted
 * @param {Boolean} {once=false} true if the listener should only
 *    be notified for the first event, false if the listener should
 *    be notified for all events.
 * @example
 * Class.on('init', function() {
 *   // will be called everytime the "init" event is fired/emitted
 * });
 */

/**
 * Adds a one time listener for the Event. This listener is
 * invoked only the next time the event is fired, after which it is removed.
 *
 * @function Class#once
 * @param {String} type - type of the listener.
 * @param {Function} listener - the listener
 * @example
 * Class.once('init', function() {
 *   // will be called only for the first time the "init" event is fired/emitted
 * });
 */

/**
 * Add a listener which will be called back. An alias for the on() function.
 *
 * @function Class#addListener
 * @example
 * Class.addListener('init', function() {
 *   // will be called everytime the "init" event is fired/emitted
 * });
 */

/**
 * Stops a specified listener from receiving further events.
 *
 * @function Class#removeListener
 * @param {String} type type of the listener
 * @param {Function} listener the listener
 * @example
 * Class.removeListener('init', listener);
 */

/**
 * Removes all the listeners that are listening for a specific type
 * of event.  Care should be taken not to disrupt other plug-ins
 * when calling this on shared event emitters that you do not control
 * yourself, for example the ones provided by Content Studio.
 *
 * @function Class#removeAllListeners
 * @param {String} type the type of events that all listeners should be removed.
 * @example
 * Class.removeAllListeners('init');
 */

/**
 * @class     Class
 * @classdesc CleverStack's base Class
 */
Class = UberClass.extend(Static, Prototype);

module.exports = Class;


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>Martina Mitchell</title>

    <link rel="stylesheet" href="css/bootstrap.min.css" type="text/css">

    <link href='http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' rel='stylesheet' type='text/css'>
    <link href='http://fonts.googleapis.com/css?family=Merriweather:400,300,300italic,400italic,700,700italic,900,900italic' rel='stylesheet' type='text/css'>
    <link rel="stylesheet" href="font-awesome/css/font-awesome.min.css" type="text/css">

    <link rel="stylesheet" href="css/animate.min.css" type="text/css">

    <link rel="stylesheet" href="css/creative.css" type="text/css">

                <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                    Toggle navigation

                </button>
                -Hipster Hacks-

                        Home

Martina Mitchell

Martina Mitchell is a University of Arizona Computer Science student whose first name is an anagram of martian. She hopes that this website comes in handy.

Do you want to contact Martina Mitchell?

Send her an email

mcmitchell@email.arizona.edu


text:
<?php

//Common function to set Output String
function set_result($myMatch, $myMsg) {
    global $total_return;
    global $add_below;
    global $loc_req;
    if ($loc_req) {
        $total_return = "Your location is currently set to $myMatch.\n";
    } else {
        $total_return = '';
    }
    $total_return .= $myMsg;
    $add_below = "\n\nTo change location, SMS NAMAZ <Your location> to 55444";
}

function getMsg($lat, $lng, $myPlace, $mydate) {
    include_once 'prayer.php';
    $time_zone = 5.5;
    $calcmethod = 1;
    $prayTime = new PrayTime($calcmethod);
    $times = $prayTime->getPrayerTimes($mydate, $lat, $lng, $time_zone);
    $msg[0] = "Namaz Timings for $myPlace on " . date('l jS \of F Y', $mydate) . "\n";
    $msg[0] .= "Fajr => " . date('h:i A', strtotime($times[0])) . "\n";
    //$msg[0] .= "Sunrise => " . date('h:i A',strtotime($times[1])) . "\n";
    $msg[0] .= "Dhuhr => " . date('h:i A', strtotime($times[2])) . "\n";
    $msg[0] .= "Asr => " . date('h:i A', strtotime($times[3])) . "\n";
    //$msg[0] .= "Sunset => " . date('h:i A',strtotime($times[4])) . "\n";
    $msg[0] .= "Maghrib => " . date('h:i A', strtotime($times[5])) . "\n";
    $msg[0] .= "Isha => " . date('h:i A', strtotime($times[6])) . "\n";

    $msg[1] = "Today's Iftar at " . date('h:i A', strtotime($times[5])) . ".($myPlace)\n";

    return $msg;
}

$isExist = false;
if ($loc_req) {
    //already searched location should match here
    $query = "SELECT namaz_loc_match.id,matched,lat,lng FROM namaz_loc_srch,namaz_loc_match where namaz_loc_srch.area = namaz_loc_match.id and typed = '" . mysql_real_escape_string($loc_req) . "'";
    echo "
$query
";
    $result = mysql_query($query) or print(mysql_error() . "  in $query");
    if (mysql_num_rows($result)) {
        $isExist = true;
    } else {
        //If reply from option list and existing in db; will match here
        $query = "SELECT id,matched,lat,lng FROM namaz_loc_match where matched = '" . mysql_real_escape_string($loc_req) . "'";
        echo "
$query
";
        $result = mysql_query($query) or print(mysql_error() . "  in $query");
    }
    if (mysql_num_rows($result)) {
        echo '
FOUND IN DB
';
        $row = mysql_fetch_array($result);
        $q = "replace into namaz_list_new(msisdn,circle,area) values('$numbers','$circle_short'," . $row['id'] . ")";
        $places = explode(',', $row['matched']);
        $msgs = getMsg($row['lat'], $row['lng'], $places[0], $getdate);
        if (mysql_query($q)) {
            set_result($row['matched'], $msgs[0]);
        }
    } else {
        if (isset($lat)) {
            $places = explode(',', $loc_req);
            $msgs = getMsg($lat, $lng, $places[0], $getdate);
            //Insertion of new Location
            $q = "insert into namaz_loc_match(matched,circle,lat,lng,msg1,msg2) values('" . mysql_real_escape_string($loc_req) . "','$circle'," . $lat . "," . $lng . ",'" . mysql_real_escape_string($msgs[0]) . "','" . mysql_real_escape_string($msgs[1]) . "')";
            if (mysql_query($q)) {
                echo "
Record inserted to namaz_loc_match
";
                echo $areaId = mysql_insert_id();
            }
            $q = "replace into namaz_list_new(msisdn,circle,area) values('$numbers','$circle_short',$areaId)";
            if (mysql_query($q)) {
                set_result($loc_req, $msgs[0]); //Setting Result String
            }
            echo $total_return;
        } else {
            //calling google api to get 'lat' and 'lng'
            $url = "http://maps.googleapis.com/maps/api/geocode/json?address=" . urlencode($loc_req) . "&sensor=true";
            $json_data = html_entity_decode(file_get_contents($url));
            $json_dec = json_decode($json_data, true);
            print_r($json_dec);
            if ($json_dec['status'] == 'OK') {        //If result found
                foreach ($json_dec['results'] as $key => $rst) {
                    //$addcount = count($rst['address_components']);
                    echo '
' . substr($rst['formatted_address'], strlen($rst['formatted_address']) - 5);
//                    if (substr($rst['formatted_address'], strlen($rst['formatted_address']) - 5) != 'India') {
//                        unset($json_dec['results'][$key]);
//                        echo '  :Removed';
//                    }
                }
                print_r($json_dec['results']);
                $json_dec['results'] = array_values($json_dec['results']);
                echo '
';
                print_r($json_dec['results']);
                if (count($json_dec['results']) == 1 || $to_logserver['isreply']) {      // If single match Found
                    $query = "SELECT id,matched,lat,lng FROM namaz_loc_match where matched = '" . mysql_real_escape_string($json_dec['results'][0]['formatted_address']) . "'";
                    echo "
$query
";
                    $result = mysql_query($query) or print(mysql_error() . "  in $query");
                    if (mysql_num_rows($result)) {  //If Matched Location is already in DB
                        echo '
 First Case';
                        $row = mysql_fetch_array($result);
                        print_r($row);
                        $places = explode(',', $row['matched']);
                        $msgs = getMsg($row['lat'], $row['lng'], $places[0], $getdate);

                        $msg1 = $msgs[0];
                        $areaId = $row['id'];
                    } else {
                        echo '
 second Case';
                        $msgs = getMsg($json_dec['results'][0]['geometry']['location']['lat'], $json_dec['results'][0]['geometry']['location']['lng'], $json_dec['results'][0]['address_components'][0]['long_name'], $getdate);
                        //Insertion of new Location
                        $q = "insert into namaz_loc_match(matched,circle,lat,lng,msg1,msg2) values('" . mysql_real_escape_string($json_dec['results'][0]['formatted_address']) . "','$circle'," . $json_dec['results'][0]['geometry']['location']['lat'] . "," . $json_dec['results'][0]['geometry']['location']['lng'] . ",'" . mysql_real_escape_string($msgs[0]) . "','" . mysql_real_escape_string($msgs[1]) . "')";
                        if (mysql_query($q)) {
                            echo "
Record inserted to namaz_loc_match
";
                            echo $areaId = mysql_insert_id();
                        }
                        $msg1 = $msgs[0];
                    }
                    //Inseting New search Text
                    echo $q = "insert into namaz_loc_srch(typed,area) values('" . mysql_real_escape_string($loc_req) . "',$areaId)";
                    if (mysql_query($q)) {
                        echo "
Record inserted to namaz_loc_srch";
                    }
                    $q = "replace into namaz_list_new(msisdn,circle,area) values('$numbers','$circle_short',$areaId)";
                    if (mysql_query($q)) {
                        set_result($json_dec['results'][0]['formatted_address'], $msg1); //Setting Result String
                    }
                    echo $total_return;
                } else if (count($json_dec['results']) > 1) {  //More than One Match
                    $istoday = false;
                    $total_return = "Your search text matches the following locations.\nPlease select one.";
                    $count = 1;
                    foreach ($json_dec['results'] as $key => $locs) {   //Location List to user to select location
                        if ($count < 10) {
                            $options_list[] = $locs['formatted_address'];
                            $list[] = array("content" => "namaz__match__loc " . $locs['formatted_address'] . " lat_ " . $locs['geometry']['location']['lat'] . " lng_ " . $locs['geometry']['location']['lng'], "count" => $count);
                            $count += 1;
                        }
                    }
                } else {
                    $total_return = "Sorry, No match found from India for '$loc_req'. Check your spelling and try again...";
                    $istoday = false;
                }
            } else {
                $total_return = "Sorry, No match found for '$loc_req'. Check your spelling and try again...";
                $istoday = false;
            }
        }
    }
//    print_r($options_list);
//    print_r($list);
} else {
    $q = "SELECT msisdn,area FROM namaz_list_new WHERE msisdn = '$numbers'";
    $r = mysql_query($q) or trigger_error("Error in $q: " . mysql_error(), E_USER_ERROR);
    if (mysql_num_rows($r)) {
        $row = mysql_fetch_array($r);
        $query = "SELECT id,matched,lat,lng FROM namaz_loc_match where id = " . $row['area'];
        echo "
$query
";
        $result = mysql_query($query) or print(mysql_error() . "  in $query");
        if (mysql_num_rows($result)) {
            echo '
FOUND IN DB
';
            $row = mysql_fetch_array($result);
            $places = explode(',', $row['matched']);
            $msgs = getMsg($row['lat'], $row['lng'], $places[0], $getdate);
            set_result($row['matched'], $msgs[0]);
        }
    } else {
        $total_return = "Location not found.\nTo get namaz timings sms NAMAZ <your location> to $shortcode";
    }
}
?>


text:
import React from "react";
import ReactCSSTransitionGroup from 'react-addons-css-transition-group';
import Controls from '../shared/Controls';
import General from "./aboutViews/General";
import Author from "./aboutViews/Author";
import HowToUse from "./aboutViews/HowToUse";
import FolderStructure from "./aboutViews/FolderStructure";

import '../../assets/stylesheets/components/about.scss';

export default class About extends React.Component {

	constructor(props) {
		super(props);
		this.state = {
			animation: "slide-animation-next",
			currentSlide: 0,
			slides: [ General, HowToUse, FolderStructure, Author ]
		};
	}

	nextSlide() {
		const size = this.state.slides.length;
		if (this.state.currentSlide < size - 1 ) {
			this.setState({
				animation: "slide-animation-next",
				currentSlide: this.state.currentSlide + 1
			})
		}
	}

	prevSlide() {
		if (this.state.currentSlide !== 0) {
			this.setState({
				animation: "slide-animation-prev",
				currentSlide: this.state.currentSlide - 1
			})
		}
	}

	goTo( index ) {
		if (index > this.state.currentSlide) {
			this.setState({
				animation: "slide-animation-next",
				currentSlide: index
			})
		}
		else {
			this.setState({
				animation: "slide-animation-prev",
				currentSlide: index
			})
		}
	}

	render() {
		const SlideName = this.state.slides[ this.state.currentSlide ];
		const transitionName = this.state.animation;

		return (
			<div className="about-wrapper">
				<Controls next = { this.nextSlide.bind(this) }
						  prev = { this.prevSlide.bind(this) }
						  current = { this.state.currentSlide }
						  arr = { this.state.slides }
						  callback = {this.goTo.bind(this)}
				></Controls>
				<ReactCSSTransitionGroup component="div" className="animated-slides" transitionName={transitionName} transitionEnterTimeout={700} transitionLeaveTimeout={700}>
				<SlideName key={this.state.currentSlide}/>
				</ReactCSSTransitionGroup>
			</div>
		);
	}
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Spilosphaerites oblongus C. Massal.

### Remarks
null


text:
package de.roamingthings.auth.security;

import de.roamingthings.auth.useraccount.domain.UserAccount;
import de.roamingthings.auth.useraccount.service.UserService;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.core.convert.converter.Converter;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Service;

/**
 * @author Alexander Sparkowsky [info@roamingthings.de]
 * @version 2017/05/07
 */
@Service("userDetailsService")
public class SpringSecUserDetailsServiceImpl implements UserDetailsService {
    private final UserService userService;
    private final Converter<UserAccount, UserDetails> userUserDetailsConverter;

    public SpringSecUserDetailsServiceImpl(UserService userService, @Qualifier("userToUserDetails") Converter<UserAccount, UserDetails> userUserDetailsConverter) {
        this.userService = userService;
        this.userUserDetailsConverter = userUserDetailsConverter;
    }

    @Override
    public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
        return userUserDetailsConverter.convert(userService.findByUsername(username));
    }
}


text:
package com.lothrazar.cyclic.item.crafting;

import net.minecraft.core.Direction;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.world.item.ItemStack;
import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.common.capabilities.ICapabilitySerializable;
import net.minecraftforge.common.util.LazyOptional;
import net.minecraftforge.items.CapabilityItemHandler;
import net.minecraftforge.items.ItemStackHandler;

public class CraftingBagCapabilityProvider implements ICapabilitySerializable<CompoundTag> {

  private final int slots = 9;
  private final LazyOptional<ItemStackHandler> inventory = LazyOptional.of(() -> new ItemStackHandler(slots) {

    @Override
    public boolean isItemValid(int slot, ItemStack stack) {
      return !(stack.getItem() instanceof CraftingBagItem) && super.isItemValid(slot, stack);
    }
  });

  public CraftingBagCapabilityProvider() {
    // is this needed?
  }

  @Override
  public <T> LazyOptional<T> getCapability(Capability<T> cap, Direction side) {
    if (cap == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) {
      return inventory.cast();
    }
    return LazyOptional.empty();
  }

  @Override
  public CompoundTag serializeNBT() {
    if (inventory.isPresent()) {
      return inventory.resolve().get().serializeNBT();
    }
    return new CompoundTag();
  }

  @Override
  public void deserializeNBT(CompoundTag nbt) {
    inventory.ifPresent(h -> h.deserializeNBT(nbt));
  }
}


text:
@interface ILTabBarTopicButton : UIView

@end


text:
#import "parser.h"
#import "symbol.h"
#import "main.h"
#import "extensions.h"
#import "object.h"
#import "objc_runtime.h"
#import "regex.h"
#import "bridge.h"
#import "class.h"
#import "enumerable.h"
#import <unistd.h>
#ifdef OPENSOLARIS
#import "pcre/pcre.h"
#else
#import "pcre.h"
#endif

#import "exception.h"

#import "version.h"

id Nu__null = 0;

bool nu_valueIsTrue(id value)
{
    bool result = value && (value != Nu__null);
    if (result && nu_objectIsKindOfClass(value, [NSNumber class])) {
        if ([value doubleValue] == 0.0)
            result = false;
    }
    return result;
}

@interface NuApplication : NSObject
{
    NSMutableArray *arguments;
}

@end

static NuApplication *_sharedApplication = 0;

@implementation NuApplication
+ (NuApplication *) sharedApplication
{
    if (!_sharedApplication)
        _sharedApplication = [[NuApplication alloc] init];
    return _sharedApplication;
}

- (void) setArgc:(int) argc argv:(const char *[])argv startingAtIndex:(int) start
{
    arguments = [[NSMutableArray alloc] init];
    int i;
    for (i = start; i < argc; i++) {
        [arguments addObject:[NSString stringWithCString:argv[i] encoding:NSUTF8StringEncoding]];
    }
}

- (NSArray *) arguments
{
    return arguments;
}

@end

void write_arguments(int argc, char *argv[])
{
    NSLog(@"launched with arguments");
    int i;
    for (i = 0; i < argc; i++) {
        NSLog(@"argv[%d]: %s", i, argv[i]);
    }
}

void NuMain_exceptionHandler(NSException* e)
{
    printf("%s\n", [[e dump] cStringUsingEncoding:NSUTF8StringEncoding]);
    exit(1);
}

#ifdef DARWIN
int NuMain(int argc, const char *argv[])
#else
int NuMain(int argc, const char *argv[], const char *envp[])
#endif
{
	#ifdef IPHONE
	NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
	#endif

    #ifdef GNUSTEP
    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
    [NSProcessInfo initializeWithArguments:(char **) argv count:argc environment:(char **) envp];
    #endif

    void NuInit();
    NuInit();

#if 0
    NSSetUncaughtExceptionHandler(&NuMain_exceptionHandler);
    [[NSExceptionHandler defaultExceptionHandler]
        setExceptionHandlingMask:(    NSHandleUncaughtExceptionMask
                                    | NSHandleUncaughtSystemExceptionMask
                                    | NSHandleUncaughtRuntimeErrorMask
                                    | NSHandleTopLevelExceptionMask
                                    | NSHandleOtherExceptionMask)];
#endif

    @try
    {
        NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];

        // first we try to load main.nu from the application bundle.
        NSString *main_path = [[NSBundle mainBundle] pathForResource:@"main" ofType:@"nu"];
        if (main_path) {
            NSString *main_nu = [NSString stringWithContentsOfFile:main_path encoding:NSUTF8StringEncoding error:nil];
            if (main_nu) {
                NuParser *parser = [[NuParser alloc] init];
                id script = [parser parse:main_nu asIfFromFilename:[main_nu cStringUsingEncoding:NSUTF8StringEncoding]];
                [parser eval:script];
                [parser release];
                [pool release];
                return 0;
            }
        }
        // if that doesn't work, use the arguments to decide what to execute
        else if (argc > 1) {
            NuParser *parser = [[NuParser alloc] init];
            id script, result;
            bool didSomething = false;
            bool goInteractive = false;
            int i = 1;
            bool fileEvaluated = false;           // only evaluate one filename
            while ((i < argc) && !fileEvaluated) {
                if (!strcmp(argv[i], "-e")) {
                    i++;
                    script = [parser parse:[NSString stringWithCString:argv[i] encoding:NSUTF8StringEncoding]];
                    result = [parser eval:script];
                    didSomething = true;
                }
                else if (!strcmp(argv[i], "-f")) {
                    i++;
                    script = [parser parse:[NSString stringWithFormat:@"(load \"%s\")", argv[i]] asIfFromFilename:argv[i]];
                    result = [parser eval:script];
                }
                else if (!strcmp(argv[i], "-v")) {
                    printf("Nu %s (%s)\n", NU_VERSION, NU_RELEASE_DATE);
                    didSomething = true;
                }
                else if (!strcmp(argv[i], "-i")) {
                    goInteractive = true;
                }
                else {
                    // collect the command-line arguments
                    [[NuApplication sharedApplication] setArgc:argc argv:argv startingAtIndex:i+1];
#ifdef DARWIN
                    id string = [NSString stringWithContentsOfFile:[NSString stringWithCString:argv[i] encoding:NSUTF8StringEncoding] encoding:NSUTF8StringEncoding error:NULL];
#else
                    id string = [NSString stringWithContentsOfFile:[NSString stringWithCString:argv[i] encoding:NSUTF8StringEncoding]];
#endif
                    if (string) {
                        id script = [parser parse:string asIfFromFilename:argv[i]];
                        [parser eval:script];
                        fileEvaluated = true;
                    }
                    else {
                        // complain somehow. Throw an exception?
                        NSLog(@"Error: can't open file named %s", argv[i]);
                    }
                    didSomething = true;
                }
                i++;
            }
#ifndef IPHONE
            if (!didSomething || goInteractive)
                [parser interact];
#endif
            [parser release];

#ifndef FREEBSD
            // FreeBSD infinite loop on emptyPool/dealloc
            [pool release];
#endif
            return 0;
        }
        // if there's no file, run at the terminal
        else {
            #if defined(DARWIN) || defined(FREEBSD)
            if (!isatty(stdin->_file))
	    #elif defined(OPENSOLARIS)
	    if (!isatty(fileno(stdin)))
            #else
                if (!isatty(stdin->_fileno))
            #endif
            {
                NuParser *parser = [[NuParser alloc] init];
                id string = [[NSString alloc] initWithData:[[NSFileHandle fileHandleWithStandardInput] readDataToEndOfFile] encoding:NSUTF8StringEncoding];
                id script = [parser parse:string asIfFromFilename:"stdin"];
                [parser eval:script];
                [parser release];
                [pool release];
            }
            else {
                [pool release];
#ifndef IPHONE
                return [NuParser main];
#endif
            }
        }
    }
	@catch (NuException* nuException)
    {
        printf("%s\n", [[nuException dump] cStringUsingEncoding:NSUTF8StringEncoding]);
	}
    @catch (id exception)
    {
        NSLog(@"Terminating due to uncaught exception (below):");
        NSLog(@"%@: %@", [exception name], [exception reason]);
    }

    #ifdef GNUSTEP
    [pool release];
    #endif

	#ifdef IPHONE
    [pool release];
	#endif
    return 0;
}

#ifdef DARWIN
static void transplant_nu_methods(Class destination, Class source)
{
    if (!nu_copyInstanceMethod(destination, source, @selector(evalWithArguments:context:)))
        NSLog(@"method copy failed");
    if (!nu_copyInstanceMethod(destination, source, @selector(sendMessage:withContext:)))
        NSLog(@"method copy failed");
    if (!nu_copyInstanceMethod(destination, source, @selector(stringValue)))
        NSLog(@"method copy failed");
    if (!nu_copyInstanceMethod(destination, source, @selector(evalWithContext:)))
        NSLog(@"method copy failed");
    if (!nu_copyInstanceMethod(destination, source, @selector(handleUnknownMessage:withContext:)))
        NSLog(@"method copy failed");
}
#endif

void NuInit()
{
    static int initialized = 0;
    if (!initialized) {
        initialized = 1;

        #ifdef DARWIN
        // note known placeholder classes
        extern void nu_note_placeholders();
        nu_note_placeholders();
        #endif

        // check UTF8 support in PCRE
        void *pcre_query_result = 0;
        pcre_config(PCRE_CONFIG_UTF8, &pcre_query_result);
        if (pcre_query_result == 0) {
            NSLog(@"Sorry, this build of Nu can't be used.");
            NSLog(@"The problem is with the PCRE (Perl-Compatible Regular Expression) library.");
            NSLog(@"Nu requires a PCRE that supports UTF8-encoded strings; the current one doesn't.");
            NSLog(@"Please see the notes/PCRE file in the Nu source distribution for more details.");
            NSLog(@"It includes instructions for building a PCRE that will work well with Nu.");
            exit(-1);
        }

        Nu__null = [NSNull null];

        // add enumeration to collection classes
        NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
        [NSArray include: [NuClass classWithClass:[NuEnumerable class]]];
        [NSSet include: [NuClass classWithClass:[NuEnumerable class]]];
        [NSString include: [NuClass classWithClass:[NuEnumerable class]]];
        [pool drain];

        [NSObject exchangeInstanceMethod:@selector(dealloc) withMethod:@selector(nuDealloc)];

        #ifdef DARWIN
        #ifndef IPHONE
        // Copy some useful methods from NSObject to NSProxy.
        // Their implementations are identical; this avoids code duplication.
        transplant_nu_methods([NSProxy class], [NSObject class]);

        void nu_swizzleContainerClasses();
        nu_swizzleContainerClasses();

        // Stop NSView from complaining when we retain alloc-ed views.
        Class NSView = NSClassFromString(@"NSView");
        [NSView exchangeInstanceMethod:@selector(retain) withMethod:@selector(nuRetain)];

        // Enable support for protocols in Nu.  Apple doesn't have an API for this, so we use our own.
	#ifndef __DARWIN_10_6_AND_LATER
        extern void nu_initProtocols();
        nu_initProtocols();
        // if you don't like making Protocol a subclass of NSObject (see nu_initProtocols), you can do this instead.
        // transplant_nu_methods([Protocol class], [NSObject class]);
	#endif

        #ifndef MININUSH
        // Load some standard files
        // Warning: since these loads are performed without a context, the non-global symbols defined in them
        // will not be available to other Nu scripts or at the console.  These loads should only be used
        // to set globals and to make changes to information stored in the ObjC runtime.
        [Nu loadNuFile:@"nu"            fromBundleWithIdentifier:@"nu.programming.framework" withContext:nil];
        [Nu loadNuFile:@"bridgesupport" fromBundleWithIdentifier:@"nu.programming.framework" withContext:nil];
        [Nu loadNuFile:@"cocoa"         fromBundleWithIdentifier:@"nu.programming.framework" withContext:nil];
        [Nu loadNuFile:@"help"          fromBundleWithIdentifier:@"nu.programming.framework" withContext:nil];
        #endif
        #endif

        #else
	// Non-Apple platforms
        #ifndef MININUSH
        [[Nu parser] parseEval:@"(load \"nu\")"];
        #endif
        #endif
    }
}

// Helpers for programmatic construction of Nu code.

id _nunull()
{
    return [NSNull null];
}

id _nustring(const char *string)
{
    return [NSString stringWithCString:string encoding:NSUTF8StringEncoding];
}

id _nustring_with_length(const char *string, int length)
{
	NSData *data = [NSData dataWithBytes:string length:length];
	return [[[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding] autorelease];
}

id _nudata(const void *bytes, int length)
{
	return [NSData dataWithBytes:bytes length:length];
}

id _nusymbol(const char *string)
{
    return [[NuSymbolTable sharedSymbolTable] symbolWithCString:string];
}

id _nusymbol_with_length(const char *string, int length)
{
	return [[NuSymbolTable sharedSymbolTable] symbolWithString:_nustring_with_length(string, length)];
}

id _nunumberd(double d)
{
    return [NSNumber numberWithDouble:d];
}

id _nucell(id car, id cdr)
{
    return [NuCell cellWithCar:car cdr:cdr];
}

id _nuregex(const char *pattern, int options)
{
    return [NuRegex regexWithPattern:_nustring(pattern) options:options];
}

id _nuregex_with_length(const char *pattern, int length, int options)
{
    return [NuRegex regexWithPattern:_nustring_with_length(pattern, length) options:options];
}

id _nulist(id firstObject, ...)
{
    id list = nil;
    id eachObject;
    va_list argumentList;
    if (firstObject) {
        // The first argument isn't part of the varargs list,
        // so we'll handle it separately.
        list = [[[NuCell alloc] init] autorelease];
        [list setCar:firstObject];
        id cursor = list;
        va_start(argumentList, firstObject);
        // Start scanning for arguments after firstObject.
        // As many times as we can get an argument of type "id"
        // that isn't nil, add it to self's contents.
        while ((eachObject = va_arg(argumentList, id))) {
            [cursor setCdr:[[[NuCell alloc] init] autorelease]];
            cursor = [cursor cdr];
            [cursor setCar:eachObject];
        }
        va_end(argumentList);
    }
    return list;
}

@implementation Nu
+ (id<NuParsing>) parser
{
    return [[[NuParser alloc] init] autorelease];
}

+ (int) sizeOfPointer
{
    return sizeof(void *);
}

+ (BOOL) loadNuFile:(NSString *) fileName fromBundleWithIdentifier:(NSString *) bundleIdentifier withContext:(NSMutableDictionary *) context
{
    BOOL success = NO;
    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
    NSBundle *bundle = [NSBundle bundleWithIdentifier:bundleIdentifier];
    NSString *filePath = [bundle pathForResource:fileName ofType:@"nu"];
    if (filePath) {
        NSString *fileNu = [NSString stringWithContentsOfFile:filePath encoding:NSUTF8StringEncoding error:nil];
        if (fileNu) {
            id parser = [Nu parser];
            id script = [parser parse:fileNu asIfFromFilename:[filePath cStringUsingEncoding:NSUTF8StringEncoding]];
            if (!context) context = [parser context];
            [script evalWithContext:context];
            success = YES;
        }
    }
    else {
        if ([bundleIdentifier isEqual:@"nu.programming.framework"]) {
            // try to read it if it's baked in

            @try
            {
                id baked_function = [NuBridgedFunction functionWithName:[NSString stringWithFormat:@"baked_%@", fileName] signature:@"@"];
                id baked_code = [baked_function evalWithArguments:nil context:nil];
                if (!context) {
                    id parser = [Nu parser];
                    context = [parser context];
                }
                [baked_code evalWithContext:context];
                success = YES;
            }
            @catch (id exception)
            {
                success = NO;
            }
        }
        else {
            success = NO;
        }
    }
    [pool release];
    return success;
}

@end


text:
using System;
using System.Net;
using Twilio.TwiML;
using Twilio.TwiML.Voice;

class Example
{
    public static void SendResponse(HttpListenerContext ctx)
    {
        HttpListenerRequest request = ctx.Request;
        HttpListenerResponse response = ctx.Response;

        response.StatusCode = (int)HttpStatusCode.OK;
        response.ContentType = "text/xml";

        // Generate TwiML
        var twiml = new VoiceResponse();
        var enqueue = new Enqueue(workflowSid: "WW0123456789abcdef0123456789abcdef");
        enqueue.Task("{\"account_number\": \"12345abcdef\"}");
        twiml.Append(enqueue);

        // Write the output and close the stream
        byte[] buffer = Encoding.UTF8.GetBytes(twiml.ToString());
        response.ContentLength64 = buffer.Length;
        response.OutputStream.Write(buffer,0, buffer.Length);
        response.OutputStream.Close();
    }
}


text:
<?php

/**
 * Thankyou page.
 * Arranges Thankyou page, sets ordering status, other parameters
 */
class Thankyou extends oxUBase
{

    /**
     * User basket object
     *
     * @var object
     */
    protected $_oBasket = null;

    /**
     * List of customer also bought thies products
     *
     * @var object
     */
    protected $_aLastProducts = null;

    /**
     * Currency conversion index value
     *
     * @var double
     */
    protected $_dConvIndex = null;

    /**
     * IPayment basket
     *
     * @var double
     */
    protected $_dIPaymentBasket = null;

    /**
     * IPayment account
     *
     * @var string
     */
    protected $_sIPaymentAccount = null;

    /**
     * IPayment user name
     *
     * @var string
     */
    protected $_sIPaymentUser = null;

    /**
     * IPayment password
     *
     * @var string
     */
    protected $_sIPaymentPassword = null;

    /**
     * Mail error
     *
     * @var string
     */
    protected $_sMailError = null;

    /**
     * Sign if to load and show bargain action
     *
     * @var bool
     */
    protected $_blBargainAction = true;

    /**
     * Current class template name.
     *
     * @var string
     */
    protected $_sThisTemplate = 'page/checkout/thankyou.tpl';

    /**
     * Executes parent::init(), loads basket from session
     * (thankyou::_oBasket = oxsession::getBasket()) then destroys
     * it (oxsession::delBasket()), unsets user session ID, if
     * this user didn't entered password while ordering.
     */
    public function init()
    {
        parent::init();

        // get basket we might need some information from it here
        $oBasket = $this->getSession()->getBasket();
        $oBasket->setOrderId(oxRegistry::getSession()->getVariable('sess_challenge'));

        // copying basket object
        $this->_oBasket = clone $oBasket;

        // delete it from the session
        $oBasket->deleteBasket();
        oxRegistry::getSession()->deleteVariable('sess_challenge');
    }

    /**
     * First checks for basket - if no such object available -
     * redirects to start page. Otherwise - executes parent::render()
     * and returns name of template to render thankyou::_sThisTemplate.
     *
     * @return  string  current template file name
     */
    public function render()
    {
        if (!$this->_oBasket || !$this->_oBasket->getProductsCount()) {
            oxRegistry::getUtils()->redirect($this->getConfig()->getShopHomeURL() . '&cl=start', true, 302);
        }

        parent::render();

        $oUser = $this->getUser();

        // removing also unregistered user info (#2580)
        if (!$oUser || !$oUser->oxuser__oxpassword->value) {
            oxRegistry::getSession()->deleteVariable('usr');
            oxRegistry::getSession()->deleteVariable('dynvalue');
        }

        // loading order sometimes needed in template
        if ($this->_oBasket->getOrderId()) {
            // owners stock reminder
            $oEmail = oxNew('oxEmail');
            $oEmail->sendStockReminder($this->_oBasket->getContents());
        }

        // we must set active class as start
        $this->getViewConfig()->setViewConfigParam('cl', 'start');

        return $this->_sThisTemplate;
    }

    /**
     * Template variable getter. Returns active basket
     *
     * @return oxBasket
     */
    public function getBasket()
    {
        return $this->_oBasket;
    }

    /**
     * Template variable getter. Returns list of customer also bought these products
     *
     * @return object
     */
    public function getAlsoBoughtTheseProducts()
    {
        if ($this->_aLastProducts === null) {
            $this->_aLastProducts = false;
            // 5th order step
            $aBasketContents = array_values($this->getBasket()->getContents());
            if ($oBasketItem = $aBasketContents[0]) {
                if ($oProduct = $oBasketItem->getArticle(false)) {
                    $this->_aLastProducts = $oProduct->getCustomerAlsoBoughtThisProducts();
                }
            }
        }

        return $this->_aLastProducts;
    }

    /**
     * Template variable getter. Returns currency conversion index value
     *
     * @return object
     */
    public function getCurrencyCovIndex()
    {
        if ($this->_dConvIndex === null) {
            // currency conversion index value
            $oCur = $this->getConfig()->getActShopCurrencyObject();
            $this->_dConvIndex = 1 / $oCur->rate;
        }

        return $this->_dConvIndex;
    }

    /**
     * Template variable getter. Returns ipayment basket price
     *
     * @return double
     */
    public function getIPaymentBasket()
    {
        if ($this->_dIPaymentBasket === null) {
            $this->_dIPaymentBasket = $this->getBasket()->getPrice()->getBruttoPrice() * 100;
        }

        return $this->_dIPaymentBasket;
    }

    /**
     * Template variable getter. Returns ipayment account
     *
     * @return string
     */
    public function getIPaymentAccount()
    {
        if ($this->_sIPaymentAccount === null) {
            $this->_sIPaymentAccount = false;
            $this->_sIPaymentAccount = $this->getConfig()->getConfigParam('iShopID_iPayment_Account');
        }

        return $this->_sIPaymentAccount;
    }

    /**
     * Template variable getter. Returns ipayment user name
     *
     * @return string
     */
    public function getIPaymentUser()
    {
        if ($this->_sIPaymentUser === null) {
            $this->_sIPaymentUser = false;
            $this->_sIPaymentUser = $this->getConfig()->getConfigParam('iShopID_iPayment_User');
        }

        return $this->_sIPaymentUser;
    }

    /**
     * Template variable getter. Returns ipayment password
     *
     * @return string
     */
    public function getIPaymentPassword()
    {
        if ($this->_sIPaymentPassword === null) {
            $this->_sIPaymentPassword = false;
            $this->_sIPaymentPassword = $this->getConfig()->getConfigParam('iShopID_iPayment_Passwort');
        }

        return $this->_sIPaymentPassword;
    }

    /**
     * Template variable getter. Returns mail error
     *
     * @return string
     */
    public function getMailError()
    {
        if ($this->_sMailError === null) {
            $this->_sMailError = false;
            $this->_sMailError = oxRegistry::getConfig()->getRequestParameter('mailerror');
        }

        return $this->_sMailError;
    }

    /**
     * Template variable getter. Returns order
     *
     * @return oxOrder
     */
    public function getOrder()
    {
        if ($this->_oOrder === null) {
            $this->_oOrder = oxNew('oxorder');
            // loading order sometimes needed in template
            if ($sOrderId = $this->getBasket()->getOrderId()) {
                $this->_oOrder->load($sOrderId);
            }
        }

        return $this->_oOrder;
    }

    /**
     * Template variable getter. Returns country ISO 3
     *
     * @return string
     */
    public function getCountryISO3()
    {
        $oOrder = $this->getOrder();
        if ($oOrder) {
            $oCountry = oxNew('oxCountry');
            $oCountry->load($oOrder->oxorder__oxbillcountryid->value);

            return $oCountry->oxcountry__oxisoalpha3->value;
        }
    }

    /**
     * Returns name of a view class, which will be active for an action
     * (given a generic fnc, e.g. logout)
     *
     * @return string
     */
    public function getActionClassName()
    {
        return 'start';
    }

    /**
     * Returns Bread Crumb - you are here page1/page2/page3...
     *
     * @return array
     */
    public function getBreadCrumb()
    {
        $aPaths = array();
        $aPath = array();

        $iLang = oxRegistry::getLang()->getBaseLanguage();
        $aPath['title'] = oxRegistry::getLang()->translateString('ORDER_COMPLETED', $iLang, false);
        $aPath['link']  = $this->getLink();
        $aPaths[] = $aPath;

        return $aPaths;
    }
}


text:
require 'codebreaker/user.rb'
require 'codebreaker/version.rb'
require 'yaml'

class String
  def is_i?
    !!(self =~ /\A[-+]?[0-9]+\z/)
  end
end

module Codebreaker
  class Game
  	def initialize
  	  @secret_code = ""
  	end

  	def start
  	  @current_user = User.new
  	  @hint_count = 0
  	  gen_secrete_code
  	end

  	def hint
  	  result_string = "****"
  	  @hint_count = @hint_count + 1 if @hint_count < 4

  	  @hint_count.times do |i|
   	    result_string[i] = @secret_code[i]
  	  end

  	  result_string
  	end

  	def try_number(users_number)
  	  raise ArgumentError.new unless users_number.instance_of?(String)
  	  raise ArgumentError.new unless users_number.size == 4
  	  raise ArgumentError.new unless users_number.is_i?

  	  result_string = ""
  	  users_number.chars.each_with_index do |ch, index|
  	    if ch == @secret_code[index]
  	  	  result_string += '+'
  	  	  users_number = users_number.chars.delete_if { |i| i == ch }.to_s
  	  	end
  	  end

  	  result_arr = @secret_code.chars & users_number.chars
  	  result_arr.size.times { result_string += '-' }

  	  @current_user.turns += 1

      return result_string.empty? ? "Wrong answer. Try again" : result_string
  	end

  	def save_user_data_to(file)
  	  File.open(file, "a") { |file| file.puts(@current_user.to_yaml) }
  	end

	  def set_current_user_name(name)
	    @current_user.name = name
	  end

	  def get_current_user_name
	    @current_user.name
	  end

	  private
  	def gen_secrete_code
  	  4.times do
  	    @secret_code += rand(7).to_s
  	  end
  	end

  end
 end


text:
#import <Foundation/Foundation.h>

@protocol ABI8_0_0RCTInvalidating <NSObject>

- (void)invalidate;

@end


text:
package eu.rethink.mn.pipeline.handlers;

import io.vertx.core.Handler;
import eu.rethink.mn.pipeline.PipeContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author micaelpedrosa@gmail.com
 * Message interceptor for inter-domain routing
 */
public class TransitionPipeHandler implements Handler<PipeContext> {
	public static String NAME = "mn:/transition";
	static final Logger logger = LoggerFactory.getLogger("BROKER");

	@Override
	public void handle(PipeContext ctx) {
		final String from = ctx.getMessage().getFrom();
		String scheme = from.split("://")[0];
		System.out.println("Scheme:" + scheme + "\nFrom:" + from);
		//search for unregistered hyperties...
		//TODO: should it be verified (security risk of registering a listener for not owned hyperties)
		if (!from.startsWith("hyperty-runtime") && from.startsWith("hyperty")) {
			if (ctx.resolve(from) == null) {
				logger.info("T-HYPERTY: " + from);
				ctx.getSession().allocate(from);
			}
		}

		ctx.next();
	}

}


text:
<?php

namespace Google\AdsApi\AdManager\v202211;

/**
 * This file was generated from WSDL. DO NOT EDIT.
 */
abstract class CustomCriteriaLeaf extends \Google\AdsApi\AdManager\v202211\CustomCriteriaNode
{

    public function __construct()
    {

    }

}


text:
package data;

import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.Date;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.logging.Level;
import java.util.logging.Logger;
import registry.Medication;
import registry.Therapy;
import registry.TreatmentHistory;
import utility.ConnectionPool;
import utility.DatabaseUtility;

/**
 * This class accesses the database to update and retrieve patient treatment
 * information.
 *
 * @author Bryan Daniel
 * @version 2, March 16, 2017
 */
public class PatientTreatmentDataAccess {

    /**
     * This method connects to the database to record a treatment for a patient.
     *
     * @param patientId the patient id
     * @param rxClass the prescription class
     * @param medications the medications
     * @param thisDate the date
     * @param userName the user name
     * @param clinicId the clinic id
     * @return the boolean indicating the success or failure of the operation
     */
    public static boolean addTreatment(int patientId, String rxClass,
            String[] medications, Date thisDate, String userName,
            int clinicId) {
        ConnectionPool pool = ConnectionPool.getInstance();
        Connection connection = pool.getConnection();
        CallableStatement cs = null;

        try {
            connection.setAutoCommit(false);
            cs = connection.prepareCall("{CALL addTreatment(?, ?, ?, ?, ?, ?)}");

            for (String s : medications) {
                cs.setInt(1, patientId);
                cs.setString(2, rxClass);
                cs.setString(3, s);
                cs.setDate(4, thisDate);
                cs.setString(5, userName);
                cs.setInt(6, clinicId);
                cs.addBatch();
            }

            /* no result set to return */
            cs.executeBatch();
            connection.commit();
            connection.setAutoCommit(true);

        } catch (SQLException ex) {
            try {
                connection.rollback();
                connection.setAutoCommit(true);
            } catch (SQLException e) {
                Logger.getLogger(PatientTreatmentDataAccess.class.getName()).log(Level.SEVERE,
                        "An exception occurred during rollback in the addTreatment method.", e);
            }
            Logger.getLogger(PatientTreatmentDataAccess.class.getName())
                    .log(Level.SEVERE, "A SQLException occurred during the addTreatment method.", ex);
            return false;
        } finally {
            DatabaseUtility.closeCallableStatement(cs);
            pool.freeConnection(connection);
        }
        return true;
    }

    /**
     * This method connects to the database to get the treatment history of a
     * patient.
     *
     * @param patientId the patient id
     * @return the treatment history of the patient or null if results are
     * missing
     */
    public static TreatmentHistory getTreatments(Integer patientId) {
        TreatmentHistory treatments = new TreatmentHistory();
        ArrayList<Therapy> therapies = new ArrayList<>();
        ArrayList<Medication> medications = new ArrayList<>();
        ConnectionPool pool = ConnectionPool.getInstance();
        Connection connection = pool.getConnection();
        CallableStatement cs = null;
        ResultSet rs = null;

        try {
            cs = connection.prepareCall("{CALL getTreatment(?, ?)}");
            cs.setInt(1, patientId);
            cs.registerOutParameter(2, java.sql.Types.TINYINT);

            /* therapies */
            boolean success = cs.execute();
            if (!success) {
                return null;
            }

            rs = cs.getResultSet();
            while (rs.next()) {
                Therapy th = new Therapy();
                th.setPrescriptionClass(rs.getString("rx class"));
                th.setTherapyType(rs.getString("therapy type"));
                th.setDateReviewed(rs.getDate("date recorded"));
                therapies.add(th);
            }

            DatabaseUtility.closeResultSet(rs);

            /* medications */
            success = cs.getMoreResults();
            if (!success) {
                return null;
            }

            rs = cs.getResultSet();
            while (rs.next()) {
                Medication m = new Medication();
                m.setMedicationId(rs.getString("med id"));
                m.setMedicationName(rs.getString("med name"));
                m.setMedicationClass(rs.getString("med class"));
                m.setDateReviewed(rs.getDate("date recorded"));
                medications.add(m);
            }

            if (therapies.isEmpty()) {
                treatments.setTherapies(null);
            } else {
                treatments.setTherapies(therapies);
            }
            if (medications.isEmpty()) {
                treatments.setMedications(null);
            } else {
                treatments.setMedications(medications);
            }

        } catch (SQLException ex) {
            Logger.getLogger(PatientTreatmentDataAccess.class.getName()).log(Level.SEVERE,
                    "An exception occurred in the getTreatments method.", ex);
            return null;
        } finally {
            DatabaseUtility.closeResultSet(rs);
            DatabaseUtility.closeCallableStatement(cs);
            pool.freeConnection(connection);
        }
        return treatments;
    }
}


text:
import frappe
from frappe.utils import get_fullname

def get_leaderboards():
	leaderboards = {
		"User": {
			"fields": ["points"],
			"method": "frappe.desk.leaderboard.get_energy_point_leaderboard",
			"company_disabled": 1,
			"icon": "users",
		}
	}
	return leaderboards

@frappe.whitelist()
def get_energy_point_leaderboard(date_range, company=None, field=None, limit=None):
	all_users = frappe.db.get_all(
		"User",
		filters={
			"name": ["not in", ["Administrator", "Guest"]],
			"enabled": 1,
			"user_type": ["!=", "Website User"],
		},
		order_by="name ASC",
	)
	all_users_list = list(map(lambda x: x["name"], all_users))

	filters = [["type", "!=", "Review"], ["user", "in", all_users_list]]
	if date_range:
		date_range = frappe.parse_json(date_range)
		filters.append(["creation", "between", [date_range[0], date_range[1]]])
	energy_point_users = frappe.db.get_all(
		"Energy Point Log",
		fields=["user as name", "sum(points) as value"],
		filters=filters,
		group_by="user",
		order_by="value desc",
	)

	energy_point_users_list = list(map(lambda x: x["name"], energy_point_users))
	for user in all_users_list:
		if user not in energy_point_users_list:
			energy_point_users.append({"name": user, "value": 0})

	for user in energy_point_users:
		user_id = user["name"]
		user["name"] = get_fullname(user["name"])
		user["formatted_name"] = '{}'.format(
			user_id, get_fullname(user_id)
		)

	return energy_point_users


text:
'use strict';

angular.module('app.home').controller('FooterController', ['$scope',
  function ($scope) {
    $scope.brand = 'The Digital Garage';
  }
]);


text:
package org.apache.gearpump.streaming.examples.fsio

import java.io.File
import java.time.Instant
import scala.collection.mutable.ArrayBuffer

import akka.actor.ActorSystem
import akka.testkit.TestProbe
import org.apache.hadoop.conf.Configuration
import org.apache.hadoop.fs.{FileSystem, Path}
import org.apache.hadoop.io.SequenceFile.Reader
import org.apache.hadoop.io.{SequenceFile, Text}
import org.mockito.Mockito._
import org.scalacheck.Gen
import org.scalatest.prop.PropertyChecks
import org.scalatest.{BeforeAndAfter, Matchers, PropSpec}

import org.apache.gearpump.Message
import org.apache.gearpump.cluster.{TestUtil, UserConfig}
import org.apache.gearpump.streaming.task.TaskId
import org.apache.gearpump.streaming.{MockUtil, Processor}
class SeqFileStreamProcessorSpec
  extends PropSpec with PropertyChecks with Matchers with BeforeAndAfter {

  val kvPairs = new ArrayBuffer[(String, String)]
  val outputDirectory = "SeqFileStreamProcessor_Test"
  val sequenceFilePath = new Path(outputDirectory + File.separator + TaskId(0, 0))
  val hadoopConf = new Configuration()
  val fs = FileSystem.get(hadoopConf)
  val textClass = new Text().getClass
  val _key = new Text()
  val _value = new Text()

  val kvGenerator = for {
    key <- Gen.alphaStr
    value <- Gen.alphaStr
  } yield (key, value)

  before {
    implicit val system1 = ActorSystem("SeqFileStreamProcessor", TestUtil.DEFAULT_CONFIG)
    val system2 = ActorSystem("Reporter", TestUtil.DEFAULT_CONFIG)
    val watcher = TestProbe()(system1)
    val conf = HadoopConfig(UserConfig.empty.withString(SeqFileStreamProcessor.OUTPUT_PATH,
      outputDirectory)).withHadoopConf(new Configuration())
    val context = MockUtil.mockTaskContext

    val processorDescription =
      Processor.ProcessorToProcessorDescription(id = 0, Processor[SeqFileStreamProcessor](1))

    val taskId = TaskId(0, 0)
    when(context.taskId).thenReturn(taskId)

    val processor = new SeqFileStreamProcessor(context, conf)
    processor.onStart(Instant.EPOCH)

    forAll(kvGenerator) { kv =>
      val (key, value) = kv
      kvPairs.append((key, value))
      processor.onNext(Message(key + "++" + value))
    }
    processor.onStop()
  }

  property("SeqFileStreamProcessor should write the key-value pairs to a sequence file") {
    val reader = new SequenceFile.Reader(hadoopConf, Reader.file(sequenceFilePath))
    kvPairs.foreach { kv =>
      val (key, value) = kv
      if (value.length > 0 && reader.next(_key, _value)) {
        assert(_key.toString == key && _value.toString == value)
      }
    }
    reader.close()
  }

  after {
    fs.deleteOnExit(new Path(outputDirectory))
  }
}