text:
  protected:
    //.......................................................................
    // Table entry for NMEA sentence type string and its offset
    // in enumerated nmea_msg_t.  Proprietary sentences can be implemented
    // in derived classes by adding a second table.  Additional tables
    // can be singly-linked through the /previous/ member.  The instantiated
    // class's table is the head, and should be returned by the derived
    // /msg_table/ function.  Tables should be sorted alphabetically.

    struct msg_table_t {
      uint8_t             offset;  // nmea_msg_t enum starting value
      const msg_table_t  *previous;
      uint8_t             size;    // number of entries in table array
      const char * const *table;   // array of NMEA sentence strings
    };

    static const msg_table_t  nmea_msg_table __PROGMEM;

    NMEAGPS_VIRTUAL const msg_table_t *msg_table() const
      { return &nmea_msg_table; };

    //.......................................................................
    //  These virtual methods can accept or reject
    //    the talker ID (for standard sentences) or
    //    the manufacturer ID (for proprietary sentences).
    //  The default is to accept *all* IDs.
    //  Override them if you want to reject certain IDs, or you want
    //    to handle COMPLETED sentences from certain IDs differently.

    #ifdef NMEAGPS_PARSE_TALKER_ID
      NMEAGPS_VIRTUAL bool parseTalkerID( char ) { return true; };
    #endif

    #ifdef NMEAGPS_PARSE_PROPRIETARY
      #ifdef NMEAGPS_PARSE_MFR_ID
        NMEAGPS_VIRTUAL bool parseMfrID( char ) { return true; };
      #endif
    #endif

  public:
    //.......................................................................
    // Set all parsed data to initial values.

    void data_init()
    {
      fix().init();

      #ifdef NMEAGPS_PARSE_SATELLITES
        sat_count = 0;
      #endif
    }

    //.......................................................................

    enum merging_t { NO_MERGING, EXPLICIT_MERGING, IMPLICIT_MERGING };
    static const merging_t
      merging = NMEAGPS_MERGING; // see NMEAGPS_cfg.h

    enum processing_style_t { PS_POLLING, PS_INTERRUPT };
    static const processing_style_t
      processing_style = NMEAGPS_PROCESSING_STYLE;  // see NMEAGPS_cfg.h

    static const bool keepNewestFixes = NMEAGPS_KEEP_NEWEST_FIXES;

    static const bool validateChars () { return NMEAGPS_VALIDATE_CHARS; }
    static const bool validateFields() { return NMEAGPS_VALIDATE_FIELDS; }

    //.......................................................................
    //  Control access to this object.  This preserves atomicity when
    //     the processing style is interrupt-driven.

    void lock() const
      {
        if (processing_style == PS_INTERRUPT)
          noInterrupts();
      }

    void unlock() const
      {
        if (processing_style == PS_INTERRUPT)
          interrupts();
      }

  protected:
    //=======================================================================
    //   PARSING FINITE-STATE MACHINE
    //=======================================================================

    //  Current fix
    gps_fix m_fix;

    // Current parser state
    uint8_t      crc;            // accumulated CRC in the sentence
    uint8_t      fieldIndex;     // index of current field in the sentence
    uint8_t      chrCount;       // index of current character in current field
    uint8_t      decimal;        // digits received after the decimal point
    struct {
      bool     negative          NEOGPS_BF(1); // field had a leading '-'
      bool     _comma_needed     NEOGPS_BF(1); // field needs a comma to finish parsing
      bool     group_valid       NEOGPS_BF(1); // multi-field group valid
      bool     _overrun          NEOGPS_BF(1); // an entire fix was dropped
      bool     _intervalComplete NEOGPS_BF(1); // automatically set after LAST received
      #if (NMEAGPS_FIX_MAX == 0)
        bool   _fixesAvailable   NEOGPS_BF(1);
      #endif
      #ifdef NMEAGPS_PARSE_PROPRIETARY
        bool   proprietary       NEOGPS_BF(1); // receiving proprietary message
      #endif
    } NEOGPS_PACKED;

    #ifdef NMEAGPS_PARSING_SCRATCHPAD
      union {
        uint32_t U4;
        uint16_t U2[2];
        uint8_t  U1[4];
      } scratchpad;
    #endif

    bool comma_needed()
    {
      #ifdef NMEAGPS_COMMA_NEEDED
        return _comma_needed;
      #else
        return false;
      #endif
    }

    void comma_needed( bool value )
    {
      #ifdef NMEAGPS_COMMA_NEEDED
        _comma_needed = value;
      #endif
    }

    // Internal FSM states
    enum rxState_t {
        NMEA_IDLE,             // Waiting for initial '$'
        NMEA_RECEIVING_HEADER, // Parsing sentence type field
        NMEA_RECEIVING_DATA,   // Parsing fields up to the terminating '*'
        NMEA_RECEIVING_CRC     // Receiving two-byte transmitted CRC
    };
    CONST_CLASS_DATA uint8_t NMEA_FIRST_STATE = NMEA_IDLE;
    CONST_CLASS_DATA uint8_t NMEA_LAST_STATE  = NMEA_RECEIVING_CRC;

    rxState_t rxState NEOGPS_BF(8);

    //.......................................................................

    uint8_t _available() const volatile { return _fixesAvailable; };

    //.......................................................................
    //  Buffered fixes.

    #if (NMEAGPS_FIX_MAX > 0)
      gps_fix buffer[ NMEAGPS_FIX_MAX ]; // could be empty, see NMEAGPS_cfg.h
      uint8_t _fixesAvailable;
      uint8_t _firstFix;
      uint8_t _currentFix;
    #endif

    //.......................................................................
    // Indicate that the next sentence should initialize the internal data.
    //    This is useful for coherency or custom filtering.

    bool intervalComplete() const { return _intervalComplete; }
    void intervalComplete( bool val ) { _intervalComplete = val; }

    //.......................................................................
    //  Identify when an update interval is completed, according to the
    //  most recently-received sentence.  In this base class, it just
    //  looks at the nmeaMessage member.  Derived classes may have
    //  more complex, specific conditions.

    NMEAGPS_VIRTUAL bool intervalCompleted() const
      { return (nmeaMessage == LAST_SENTENCE_IN_INTERVAL); }
                               // see NMEAGPS_cfg.h

    //.......................................................................
    //  When a fix has been fully assembled from a batch of sentences, as
    //  determined by the configured merging technique and ending with the
    //  LAST_SENTENCE_IN_INTERVAL, it is stored in the (optional) buffer
    //  of fixes.  They are removed with /read()/.

    void storeFix();

    //=======================================================================
    //   PARSING METHODS
    //=======================================================================

    //.......................................................................
    // Try to recognize an NMEA sentence type, after the IDs have been accepted.

    decode_t parseCommand( char c );
    decode_t parseCommand( const msg_table_t *msgs, uint8_t cmdCount, char c );

    //.......................................................................
    // Parse various NMEA sentences

    bool parseGGA( char chr );
    bool parseGLL( char chr );
    bool parseGSA( char chr );
    bool parseGST( char chr );
    bool parseGSV( char chr );
    bool parseRMC( char chr );
    bool parseVTG( char chr );
    bool parseZDA( char chr );

    //.......................................................................
    // Depending on the NMEA sentence type, parse one field of an expected type.

    NMEAGPS_VIRTUAL bool parseField( char chr );

    //.......................................................................
    // Parse the primary NMEA field types into /fix/ members.

    bool parseFix        ( char chr ); // aka STATUS or MODE
    bool parseTime       ( char chr );
    bool parseDDMMYY     ( char chr );
    bool parseLat        ( char chr );
    bool parseNS         ( char chr );
    bool parseLon        ( char chr );
    bool parseEW         ( char chr );
    bool parseSpeed      ( char chr );
    bool parseSpeedKph   ( char chr );
    bool parseHeading    ( char chr );
    bool parseAlt        ( char chr );
    bool parseGeoidHeight( char chr );
    bool parseHDOP       ( char chr );
    bool parseVDOP       ( char chr );
    bool parsePDOP       ( char chr );
    bool parse_lat_err   ( char chr );
    bool parse_lon_err   ( char chr );
    bool parse_alt_err   ( char chr );
    bool parseSatellites ( char chr );

    // Helper macro for parsing the 4 consecutive fields of a location
    #define PARSE_LOC(i) case i: return parseLat( chr );\
      case i+1: return parseNS ( chr ); \
      case i+2: return parseLon( chr ); \
      case i+3: return parseEW ( chr );

    //.......................................................................
    // Parse floating-point numbers into a /whole_frac/
    // @return true when the value is fully populated.

    bool parseFloat( gps_fix::whole_frac & val, char chr, uint8_t max_decimal );

    //.......................................................................
    // Parse floating-point numbers into a uint16_t
    // @return true when the value is fully populated.

    bool parseFloat( uint16_t & val, char chr, uint8_t max_decimal );

    //.......................................................................
    // Parse NMEA lat/lon dddmm.mmmm degrees

    bool parseDDDMM
      (
        #if defined( GPS_FIX_LOCATION )
          int32_t & val,
        #endif
        #if defined( GPS_FIX_LOCATION_DMS )
          DMS_t & dms,
        #endif
        char chr
      );

    //.......................................................................
    // Parse integer into 8-bit int
    // @return true when non-empty value

    bool parseInt( uint8_t &val, uint8_t chr )
    {
      negative = false;
      bool is_comma = (chr == ',');

      if (chrCount == 0) {
        if (is_comma)
          return false; // empty field!

        if (((validateChars() || validateFields()) && (chr == '-')) ||
            (validateChars() && !isdigit( chr )))
          sentenceInvalid();
        else
          val = (chr - '0');

      } else if (!is_comma) {

        if (validateChars() && !isdigit( chr ))
          sentenceInvalid();
        else
          val = (val*10) + (chr - '0');
      }
      return true;
    }

    //.......................................................................
    // Parse integer into signed 8-bit int
    // @return true when non-empty value

    bool parseInt( int8_t &val, uint8_t chr )
    {
      bool is_comma = (chr == ',');

      if (chrCount == 0) {
        if (is_comma)
          return false; // empty field!

        negative = (chr == '-');
        if (negative) {
          comma_needed( true ); // to negate
          val = 0;
        } else if (validateChars() && !isdigit( chr )) {
          sentenceInvalid();
        } else {
          val = (chr - '0');
        }
      } else if (!is_comma) {
        val = (val*10) + (chr - '0');

      } else if (negative) {
        val = -val;
      }

      return true;
    }

    //.......................................................................
    // Parse integer into 16-bit int
    // @return true when non-empty value

    bool parseInt( uint16_t &val, uint8_t chr )
    {
      negative = false;

      bool is_comma = (chr == ',');
      if (chrCount == 0) {
        if (is_comma)
          return false; // empty field!

        if (((validateChars() || validateFields()) && (chr == '-')) ||
            (validateChars() && !isdigit( chr )))
          sentenceInvalid();
        else
          val = (chr - '0');

      } else if (!is_comma) {

        if (validateChars() && !isdigit( chr ))
          sentenceInvalid();
        else
          val = (val*10) + (chr - '0');
      }
      return true;
    }

    //.......................................................................
    // Parse integer into 32-bit int
    // @return true when non-empty value

    bool parseInt( uint32_t &val, uint8_t chr )
    {
      negative = false;

      bool is_comma = (chr == ',');
      if (chrCount == 0) {
        if (is_comma)
          return false; // empty field!

        if (((validateChars() || validateFields()) && (chr == '-')) ||
            (validateChars() && !isdigit( chr )))
          sentenceInvalid();
        else
          val = (chr - '0');

      } else if (!is_comma) {

        if (validateChars() && !isdigit( chr ))
          sentenceInvalid();
        else
          val = (val*10) + (chr - '0');
      }
      return true;
    }

  private:
    void sentenceBegin       ();
    void sentenceOk          ();
    void sentenceInvalid     ();
    void sentenceUnrecognized();
    void headerReceived      ();


text:
Xpath is very powerful query language. But sometimes, you do not need this power. You need just to grab some page in simple way - using css selectors.
Css selectors are widely used. They are simple.

You need additional library called `xparse/css-expression-translator`

Install it via composer:
```sh
composer require xparse/css-expression-translator
```

Configure element finder
```php
  $finder->setExpressionTranslator(new CssExpressionTranslator());
```

## Example
Here is full working example:
```php

  require 'vendor/autoload.php';

  use Xparse\CssExpressionTranslator\CssExpressionTranslator;
  use Xparse\ElementFinder\ElementFinder;

  $finder = new ElementFinder('<div>
      <a href="#page">123</a>
      <a href="#second" class="test">321<span>ad</span></a>
</div>');

  $finder->setExpressionTranslator(new CssExpressionTranslator());

  # 321<span>ad</span>
  echo $finder->html('a.test')->getFirst();
```

## How it works?
This library build on top of the `symfony/css-selector` [https://github.com/symfony/css-selector](https://github.com/symfony/css-selector)

## How to select attributes with css?
Add space before attribute name.
```php
  $finder->attributes('a @href');
  $finder->attributes('a.test @class');

  // slect node text
  $finder->value('a.test node()');
```

## Limits
There are some limits.
- Xpath is more powerful than css.
- you cant select attributes with `or` operator
- fetch function result `a concat('text:', text())`

redpajama_set_name: RedPajamaGithub


text:
\hypertarget{classodf_1_1userfield_1_1UserFields}{\section{odf.\+userfield.\+User\+Fields Class Reference}
\label{classodf_1_1userfield_1_1UserFields}\index{odf.\+userfield.\+User\+Fields@{odf.\+userfield.\+User\+Fields}}
}

List, view and manipulate user fields.

Inheritance diagram for odf.\+userfield.\+User\+Fields\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=198pt]{classodf_1_1userfield_1_1UserFields__inherit__graph}
\end{center}
\end{figure}

Collaboration diagram for odf.\+userfield.\+User\+Fields\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=198pt]{classodf_1_1userfield_1_1UserFields__coll__graph}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item
def \hyperlink{classodf_1_1userfield_1_1UserFields_a5181a6106854423e1e28a83455aa9e94}{\+\_\+\+\_\+init\+\_\+\+\_\+}
\begin{DoxyCompactList}\small\item\em Constructor. \end{DoxyCompactList}\item
def \hyperlink{classodf_1_1userfield_1_1UserFields_a65ccd99e2c198f06b55551d6a7bbf59a}{loaddoc}
\item
def \hyperlink{classodf_1_1userfield_1_1UserFields_ae5336dcb2cdaee62f02d16cdb8945a2f}{savedoc}
\item
def \hyperlink{classodf_1_1userfield_1_1UserFields_a9151edeae09fcea4b334a445d7efc6b0}{list\+\_\+fields}
\begin{DoxyCompactList}\small\item\em List (extract) all known user-\/fields. \end{DoxyCompactList}\item
def \hyperlink{classodf_1_1userfield_1_1UserFields_ae67ac78a3c883117d523f245f076b227}{list\+\_\+fields\+\_\+and\+\_\+values}
\begin{DoxyCompactList}\small\item\em List (extract) user-\/fields with type and value. \end{DoxyCompactList}\item
def \hyperlink{classodf_1_1userfield_1_1UserFields_a1ca142bc38126c2d15a9a40e94c9d21c}{list\+\_\+values}
\begin{DoxyCompactList}\small\item\em Extract the contents of given field names from the file. \end{DoxyCompactList}\item
def \hyperlink{classodf_1_1userfield_1_1UserFields_a916cc9d873f57f30b69e752bb48d5bff}{get}
\begin{DoxyCompactList}\small\item\em Extract the contents of this field from the file. \end{DoxyCompactList}\item
def \hyperlink{classodf_1_1userfield_1_1UserFields_a532884dffd16a0a946aa961ea442d3ca}{get\+\_\+type\+\_\+and\+\_\+value}
\begin{DoxyCompactList}\small\item\em Extract the type and contents of this field from the file. \end{DoxyCompactList}\item
def \hyperlink{classodf_1_1userfield_1_1UserFields_aa13e8293efd5d183ac771d07b56a4558}{update}
\begin{DoxyCompactList}\small\item\em Set the value of user fields. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Public Attributes}
\begin{DoxyCompactItemize}
\item
\hyperlink{classodf_1_1userfield_1_1UserFields_adfbbf12e8d9c5377410d463070b5bd76}{document}
\end{DoxyCompactItemize}
\subsection*{Static Public Attributes}
\begin{DoxyCompactItemize}
\item
\hyperlink{classodf_1_1userfield_1_1UserFields_aab129a38d3cc36d3ca8469de9a04c5a9}{src\+\_\+file} = None
\item
\hyperlink{classodf_1_1userfield_1_1UserFields_a4ff1ceee3cb418e2b72d6c0366fb63b3}{dest\+\_\+file} = None
\end{DoxyCompactItemize}

\subsection{Detailed Description}
List, view and manipulate user fields.

Definition at line 53 of file userfield.\+py.

\subsection{Constructor \& Destructor Documentation}
\hypertarget{classodf_1_1userfield_1_1UserFields_a5181a6106854423e1e28a83455aa9e94}{\index{odf\+::userfield\+::\+User\+Fields@{odf\+::userfield\+::\+User\+Fields}!\+\_\+\+\_\+init\+\_\+\+\_\+@{\+\_\+\+\_\+init\+\_\+\+\_\+}}
\index{\+\_\+\+\_\+init\+\_\+\+\_\+@{\+\_\+\+\_\+init\+\_\+\+\_\+}!odf\+::userfield\+::\+User\+Fields@{odf\+::userfield\+::\+User\+Fields}}
\subsubsection[{\+\_\+\+\_\+init\+\_\+\+\_\+}]{\setlength{\rightskip}{0pt plus 5cm}def odf.\+userfield.\+User\+Fields.\+\_\+\+\_\+init\+\_\+\+\_\+ (
\begin{DoxyParamCaption}
\item[{}]{self, }
\item[{}]{src = {\ttfamily None}, }
\item[{}]{dest = {\ttfamily None}}
\end{DoxyParamCaption}
)}}\label{classodf_1_1userfield_1_1UserFields_a5181a6106854423e1e28a83455aa9e94}

Constructor.

\begin{DoxyParams}{Parameters}
{\em src} & open file in binary mode\+: source document, or filename as a unicode string, or None for stdin. \\
\hline
{\em dest} & opendile in binary mode\+: destination document, or filename as a unicode string, or None for stdout. \\
\hline
\end{DoxyParams}

Definition at line 67 of file userfield.\+py.

\subsection{Member Function Documentation}
\hypertarget{classodf_1_1userfield_1_1UserFields_a916cc9d873f57f30b69e752bb48d5bff}{\index{odf\+::userfield\+::\+User\+Fields@{odf\+::userfield\+::\+User\+Fields}!get@{get}}
\index{get@{get}!odf\+::userfield\+::\+User\+Fields@{odf\+::userfield\+::\+User\+Fields}}
\subsubsection[{get}]{\setlength{\rightskip}{0pt plus 5cm}def odf.\+userfield.\+User\+Fields.\+get (
\begin{DoxyParamCaption}
\item[{}]{self, }
\item[{}]{field\+\_\+name}
\end{DoxyParamCaption}
)}}\label{classodf_1_1userfield_1_1UserFields_a916cc9d873f57f30b69e752bb48d5bff}

Extract the contents of this field from the file.

\begin{DoxyParams}{Parameters}
{\em field\+\_\+name} & unicode string\+: name of a field \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
field value as a unicode string or None if field does not exist.
\end{DoxyReturn}

Definition at line 146 of file userfield.\+py.

Here is the call graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classodf_1_1userfield_1_1UserFields_a916cc9d873f57f30b69e752bb48d5bff_cgraph}
\end{center}
\end{figure}

\hypertarget{classodf_1_1userfield_1_1UserFields_a532884dffd16a0a946aa961ea442d3ca}{\index{odf\+::userfield\+::\+User\+Fields@{odf\+::userfield\+::\+User\+Fields}!get\+\_\+type\+\_\+and\+\_\+value@{get\+\_\+type\+\_\+and\+\_\+value}}
\index{get\+\_\+type\+\_\+and\+\_\+value@{get\+\_\+type\+\_\+and\+\_\+value}!odf\+::userfield\+::\+User\+Fields@{odf\+::userfield\+::\+User\+Fields}}
\subsubsection[{get\+\_\+type\+\_\+and\+\_\+value}]{\setlength{\rightskip}{0pt plus 5cm}def odf.\+userfield.\+User\+Fields.\+get\+\_\+type\+\_\+and\+\_\+value (
\begin{DoxyParamCaption}
\item[{}]{self, }
\item[{}]{field\+\_\+name}
\end{DoxyParamCaption}
)}}\label{classodf_1_1userfield_1_1UserFields_a532884dffd16a0a946aa961ea442d3ca}

Extract the type and contents of this field from the file.

\begin{DoxyParams}{Parameters}
{\em field\+\_\+name} & unicode string\+: name of a field \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
tuple ($<$type$>$, $<$field-\/value$>$) as a pair of unicode strings or None if field does not exist.
\end{DoxyReturn}

Definition at line 160 of file userfield.\+py.

Here is the call graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classodf_1_1userfield_1_1UserFields_a532884dffd16a0a946aa961ea442d3ca_cgraph}
\end{center}
\end{figure}

\hypertarget{classodf_1_1userfield_1_1UserFields_a9151edeae09fcea4b334a445d7efc6b0}{\index{odf\+::userfield\+::\+User\+Fields@{odf\+::userfield\+::\+User\+Fields}!list\+\_\+fields@{list\+\_\+fields}}
\index{list\+\_\+fields@{list\+\_\+fields}!odf\+::userfield\+::\+User\+Fields@{odf\+::userfield\+::\+User\+Fields}}
\subsubsection[{list\+\_\+fields}]{\setlength{\rightskip}{0pt plus 5cm}def odf.\+userfield.\+User\+Fields.\+list\+\_\+fields (
\begin{DoxyParamCaption}
\item[{}]{self}
\end{DoxyParamCaption}
)}}\label{classodf_1_1userfield_1_1UserFields_a9151edeae09fcea4b334a445d7efc6b0}

List (extract) all known user-\/fields.

\begin{DoxyReturn}{Returns}
list of user-\/field names as unicode strings.
\end{DoxyReturn}

Definition at line 98 of file userfield.\+py.

Here is the call graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classodf_1_1userfield_1_1UserFields_a9151edeae09fcea4b334a445d7efc6b0_cgraph}
\end{center}
\end{figure}

\hypertarget{classodf_1_1userfield_1_1UserFields_ae67ac78a3c883117d523f245f076b227}{\index{odf\+::userfield\+::\+User\+Fields@{odf\+::userfield\+::\+User\+Fields}!list\+\_\+fields\+\_\+and\+\_\+values@{list\+\_\+fields\+\_\+and\+\_\+values}}
\index{list\+\_\+fields\+\_\+and\+\_\+values@{list\+\_\+fields\+\_\+and\+\_\+values}!odf\+::userfield\+::\+User\+Fields@{odf\+::userfield\+::\+User\+Fields}}
\subsubsection[{list\+\_\+fields\+\_\+and\+\_\+values}]{\setlength{\rightskip}{0pt plus 5cm}def odf.\+userfield.\+User\+Fields.\+list\+\_\+fields\+\_\+and\+\_\+values (
\begin{DoxyParamCaption}
\item[{}]{self, }
\item[{}]{field\+\_\+names = {\ttfamily None}}
\end{DoxyParamCaption}
)}}\label{classodf_1_1userfield_1_1UserFields_ae67ac78a3c883117d523f245f076b227}

List (extract) user-\/fields with type and value.

\begin{DoxyParams}{Parameters}
{\em field\+\_\+names} & list of field names as unicode strings to show, or None for all.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
list of tuples ($<$field name$>$=\char`\"{}\char`\"{}$>$, $<$field type$>$=\char`\"{}\char`\"{}$>$,
\end{DoxyReturn}
) as type (unicode string, stringified type, unicode string).

Definition at line 111 of file userfield.\+py.

Here is the call graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classodf_1_1userfield_1_1UserFields_ae67ac78a3c883117d523f245f076b227_cgraph}
\end{center}
\end{figure}

Here is the caller graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classodf_1_1userfield_1_1UserFields_ae67ac78a3c883117d523f245f076b227_icgraph}
\end{center}
\end{figure}

\hypertarget{classodf_1_1userfield_1_1UserFields_a1ca142bc38126c2d15a9a40e94c9d21c}{\index{odf\+::userfield\+::\+User\+Fields@{odf\+::userfield\+::\+User\+Fields}!list\+\_\+values@{list\+\_\+values}}
\index{list\+\_\+values@{list\+\_\+values}!odf\+::userfield\+::\+User\+Fields@{odf\+::userfield\+::\+User\+Fields}}
\subsubsection[{list\+\_\+values}]{\setlength{\rightskip}{0pt plus 5cm}def odf.\+userfield.\+User\+Fields.\+list\+\_\+values (
\begin{DoxyParamCaption}
\item[{}]{self, }
\item[{}]{field\+\_\+names}
\end{DoxyParamCaption}
)}}\label{classodf_1_1userfield_1_1UserFields_a1ca142bc38126c2d15a9a40e94c9d21c}

Extract the contents of given field names from the file.

\begin{DoxyParams}{Parameters}
{\em field\+\_\+names} & list of field names as unicode strings\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
list of field values as unicode strings.
\end{DoxyReturn}

Definition at line 137 of file userfield.\+py.

Here is the call graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classodf_1_1userfield_1_1UserFields_a1ca142bc38126c2d15a9a40e94c9d21c_cgraph}
\end{center}
\end{figure}

Here is the caller graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classodf_1_1userfield_1_1UserFields_a1ca142bc38126c2d15a9a40e94c9d21c_icgraph}
\end{center}
\end{figure}

\hypertarget{classodf_1_1userfield_1_1UserFields_a65ccd99e2c198f06b55551d6a7bbf59a}{\index{odf\+::userfield\+::\+User\+Fields@{odf\+::userfield\+::\+User\+Fields}!loaddoc@{loaddoc}}
\index{loaddoc@{loaddoc}!odf\+::userfield\+::\+User\+Fields@{odf\+::userfield\+::\+User\+Fields}}
\subsubsection[{loaddoc}]{\setlength{\rightskip}{0pt plus 5cm}def odf.\+userfield.\+User\+Fields.\+loaddoc (
\begin{DoxyParamCaption}
\item[{}]{self}
\end{DoxyParamCaption}
)}}\label{classodf_1_1userfield_1_1UserFields_a65ccd99e2c198f06b55551d6a7bbf59a}

Definition at line 74 of file userfield.\+py.

Here is the call graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classodf_1_1userfield_1_1UserFields_a65ccd99e2c198f06b55551d6a7bbf59a_cgraph}
\end{center}
\end{figure}

Here is the caller graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classodf_1_1userfield_1_1UserFields_a65ccd99e2c198f06b55551d6a7bbf59a_icgraph}
\end{center}
\end{figure}

\hypertarget{classodf_1_1userfield_1_1UserFields_ae5336dcb2cdaee62f02d16cdb8945a2f}{\index{odf\+::userfield\+::\+User\+Fields@{odf\+::userfield\+::\+User\+Fields}!savedoc@{savedoc}}
\index{savedoc@{savedoc}!odf\+::userfield\+::\+User\+Fields@{odf\+::userfield\+::\+User\+Fields}}
\subsubsection[{savedoc}]{\setlength{\rightskip}{0pt plus 5cm}def odf.\+userfield.\+User\+Fields.\+savedoc (
\begin{DoxyParamCaption}
\item[{}]{self}
\end{DoxyParamCaption}
)}}\label{classodf_1_1userfield_1_1UserFields_ae5336dcb2cdaee62f02d16cdb8945a2f}

Definition at line 85 of file userfield.\+py.

Here is the caller graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classodf_1_1userfield_1_1UserFields_ae5336dcb2cdaee62f02d16cdb8945a2f_icgraph}
\end{center}
\end{figure}

\hypertarget{classodf_1_1userfield_1_1UserFields_aa13e8293efd5d183ac771d07b56a4558}{\index{odf\+::userfield\+::\+User\+Fields@{odf\+::userfield\+::\+User\+Fields}!update@{update}}
\index{update@{update}!odf\+::userfield\+::\+User\+Fields@{odf\+::userfield\+::\+User\+Fields}}
\subsubsection[{update}]{\setlength{\rightskip}{0pt plus 5cm}def odf.\+userfield.\+User\+Fields.\+update (
\begin{DoxyParamCaption}
\item[{}]{self, }
\item[{}]{data}
\end{DoxyParamCaption}
)}}\label{classodf_1_1userfield_1_1UserFields_aa13e8293efd5d183ac771d07b56a4558}

Set the value of user fields.

The field types will be the same. \begin{DoxyVerb}    data ... dict, with field name as key, field value as value

    Returns None\end{DoxyVerb}

Definition at line 176 of file userfield.\+py.

Here is the call graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classodf_1_1userfield_1_1UserFields_aa13e8293efd5d183ac771d07b56a4558_cgraph}
\end{center}
\end{figure}

\subsection{Member Data Documentation}
\hypertarget{classodf_1_1userfield_1_1UserFields_a4ff1ceee3cb418e2b72d6c0366fb63b3}{\index{odf\+::userfield\+::\+User\+Fields@{odf\+::userfield\+::\+User\+Fields}!dest\+\_\+file@{dest\+\_\+file}}
\index{dest\+\_\+file@{dest\+\_\+file}!odf\+::userfield\+::\+User\+Fields@{odf\+::userfield\+::\+User\+Fields}}
\subsubsection[{dest\+\_\+file}]{\setlength{\rightskip}{0pt plus 5cm}odf.\+userfield.\+User\+Fields.\+dest\+\_\+file = None\hspace{0.3cm}{\ttfamily [static]}}}\label{classodf_1_1userfield_1_1UserFields_a4ff1ceee3cb418e2b72d6c0366fb63b3}

Definition at line 57 of file userfield.\+py.

\hypertarget{classodf_1_1userfield_1_1UserFields_adfbbf12e8d9c5377410d463070b5bd76}{\index{odf\+::userfield\+::\+User\+Fields@{odf\+::userfield\+::\+User\+Fields}!document@{document}}
\index{document@{document}!odf\+::userfield\+::\+User\+Fields@{odf\+::userfield\+::\+User\+Fields}}
\subsubsection[{document}]{\setlength{\rightskip}{0pt plus 5cm}odf.\+userfield.\+User\+Fields.\+document}}\label{classodf_1_1userfield_1_1UserFields_adfbbf12e8d9c5377410d463070b5bd76}

Definition at line 72 of file userfield.\+py.

\hypertarget{classodf_1_1userfield_1_1UserFields_aab129a38d3cc36d3ca8469de9a04c5a9}{\index{odf\+::userfield\+::\+User\+Fields@{odf\+::userfield\+::\+User\+Fields}!src\+\_\+file@{src\+\_\+file}}
\index{src\+\_\+file@{src\+\_\+file}!odf\+::userfield\+::\+User\+Fields@{odf\+::userfield\+::\+User\+Fields}}
\subsubsection[{src\+\_\+file}]{\setlength{\rightskip}{0pt plus 5cm}odf.\+userfield.\+User\+Fields.\+src\+\_\+file = None\hspace{0.3cm}{\ttfamily [static]}}}\label{classodf_1_1userfield_1_1UserFields_aab129a38d3cc36d3ca8469de9a04c5a9}

Definition at line 56 of file userfield.\+py.

The documentation for this class was generated from the following file\+:\begin{DoxyCompactItemize}
\item
odf/\hyperlink{userfield_8py}{userfield.\+py}\end{DoxyCompactItemize}


text:
package com.sun.jini.jeri.internal.http;

import java.io.IOException;
import java.net.Socket;

/**
 * Abstraction for objects which provide/configure sockets used by
 * HttpClientConnection instances.
 *
 *
 *
 */
public interface HttpClientSocketFactory {

    /**
     * Creates client socket connected to the given host and port.
     */
    Socket createSocket(String host, int port) throws IOException;

    /**
     * Creates layered socket on top of given base socket, for use when
     * tunneling HTTP messages through a proxy.
     */
    Socket createTunnelSocket(Socket s) throws IOException;
}


text:
using System;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http;

namespace NetEscapades.AspNetCore.SecurityHeaders.Headers
{
    /// <summary>
    /// The header value to use for Permissions-Policy.
    /// </summary>
    public class PermissionsPolicyHeader : HtmlOnlyHeaderPolicyBase
    {
        private readonly string _value;

        /// <summary>
        /// Initializes a new instance of the <see cref="PermissionsPolicyHeader"/> class.
        /// </summary>
        /// <param name="value">The value to apply for the header</param>
        public PermissionsPolicyHeader(string value)
        {
            _value = value;
        }

        /// <inheritdoc />
        public override string Header => "Permissions-Policy";

        /// <inheritdoc />
        protected override string GetValue(HttpContext context) => _value;

        /// <summary>
        /// Configure a permission policy.
        /// </summary>
        /// <param name="configure">Configure the Permissions-Policy header</param>
        /// <returns>The complete Permissions-Policy header</returns>
        public static PermissionsPolicyHeader Build(Action<PermissionsPolicyBuilder> configure)
        {
            var builder = new PermissionsPolicyBuilder();

            configure(builder);

            return new PermissionsPolicyHeader(builder.Build());
        }
    }
}


text:
package com.intellij.json.psi.impl;

import com.intellij.openapi.util.Ref;
import com.intellij.openapi.util.TextRange;
import com.intellij.psi.LiteralTextEscaper;
import com.intellij.psi.PsiLanguageInjectionHost;
import org.jetbrains.annotations.NotNull;

public abstract class JSStringLiteralEscaper<T extends PsiLanguageInjectionHost> extends LiteralTextEscaper<T> {
  private int[] outSourceOffsets;

  public JSStringLiteralEscaper(T host) {
    super(host);
  }

  public boolean decode(@NotNull final TextRange rangeInsideHost, @NotNull StringBuilder outChars) {
    String subText = rangeInsideHost.substring(myHost.getText());

    Ref<int[]> sourceOffsetsRef = new Ref<int[]>();
    boolean result = parseStringCharacters(subText, outChars, sourceOffsetsRef, isRegExpLiteral(), !isOneLine());
    outSourceOffsets = sourceOffsetsRef.get();
    return result;
  }

  protected abstract boolean isRegExpLiteral();

  public int getOffsetInHost(int offsetInDecoded, @NotNull final TextRange rangeInsideHost) {
    int result = offsetInDecoded < outSourceOffsets.length ? outSourceOffsets[offsetInDecoded] : -1;
    if (result == -1) return -1;
    return (result <= rangeInsideHost.getLength() ? result : rangeInsideHost.getLength()) + rangeInsideHost.getStartOffset();
  }

  public boolean isOneLine() {
    return true;
  }

  public static boolean parseStringCharacters(String chars, StringBuilder outChars, Ref<int[]> sourceOffsetsRef, boolean regExp, boolean escapeBacktick) {
    int[] sourceOffsets = new int[chars.length() + 1];
    sourceOffsetsRef.set(sourceOffsets);

    if (chars.indexOf('\\') < 0) {
      outChars.append(chars);
      for (int i = 0; i < sourceOffsets.length; i++) {
        sourceOffsets[i] = i;
      }
      return true;
    }

    int index = 0;
    final int outOffset = outChars.length();
    while (index < chars.length()) {
      char c = chars.charAt(index++);

      sourceOffsets[outChars.length() - outOffset] = index - 1;
      sourceOffsets[outChars.length() + 1 - outOffset] = index;

      if (c != '\\') {
        outChars.append(c);
        continue;
      }
      if (index == chars.length()) return false;
      c = chars.charAt(index++);
      if (escapeBacktick && c == '`') {
        outChars.append(c);
      } else if (regExp) {
        if (c != '/') {
          outChars.append('\\');
        }
        outChars.append(c);
      }
      else {
        switch (c) {
          case 'b':
            outChars.append('\b');
            break;

          case 't':
            outChars.append('\t');
            break;

          case 'n':
            outChars.append('\n');
            break;

          case 'f':
            outChars.append('\f');
            break;

          case 'r':
            outChars.append('\r');
            break;

          case '"':
            outChars.append('"');
            break;

          case '/':
            outChars.append('/');
            break;

          case '\n':
            outChars.append('\n');
            break;
          case '\'':
            outChars.append('\'');
            break;

          case '\\':
            outChars.append('\\');
            break;

          case '0':
          case '1':
          case '2':
          case '3':
          case '4':
          case '5':
          case '6':
          case '7': {
            char startC = c;
            int v = (int)c - '0';
            if (index < chars.length()) {
              c = chars.charAt(index++);
              if ('0' <= c && c <= '7') {
                v <<= 3;
                v += c - '0';
                if (startC <= '3' && index < chars.length()) {
                  c = chars.charAt(index++);
                  if ('0' <= c && c <= '7') {
                    v <<= 3;
                    v += c - '0';
                  }
                  else {
                    index--;
                  }
                }
              }
              else {
                index--;
              }
            }
            outChars.append((char)v);
          }
          break;
          case 'x':
            if (index + 2 <= chars.length()) {
              try {
                int v = Integer.parseInt(chars.substring(index, index + 2), 16);
                outChars.append((char)v);
                index += 2;
              }
              catch (Exception e) {
                return false;
              }
            }
            else {
              return false;
            }
            break;
          case 'u':
            if (index + 4 <= chars.length()) {
              try {
                int v = Integer.parseInt(chars.substring(index, index + 4), 16);
                //line separators are invalid here
                if (v == 0x000a || v == 0x000d) return false;
                c = chars.charAt(index);
                if (c == '+' || c == '-') return false;
                outChars.append((char)v);
                index += 4;
              }
              catch (Exception e) {
                return false;
              }
            }
            else {
              return false;
            }
            break;

          default:
            return false;
        }
      }

      sourceOffsets[outChars.length() - outOffset] = index;
    }
    return true;
  }
}


text:
using System;
using TrueCraft.API.Logic;
using TrueCraft.API;
using TrueCraft.Core.Logic.Blocks;

namespace TrueCraft.Core.Logic.Items
{
    public class GoldenAppleItem : FoodItem, ICraftingRecipe
    {
        public static readonly short ItemID = 0x142;

        public override short ID { get { return 0x142; } }

        public override Tuple<int, int> GetIconTexture(byte metadata)
        {
            return new Tuple<int, int>(11, 0);
        }

        public override float Restores { get { return 10; } }

        public override string DisplayName { get { return "Golden Apple"; } }

        public ItemStack[,] Pattern
        {
            get
            {
                return new[,]
                {
                    {
                        new ItemStack(GoldBlock.BlockID),
                        new ItemStack(GoldBlock.BlockID),
                        new ItemStack(GoldBlock.BlockID),
                    },
                    {
                        new ItemStack(GoldBlock.BlockID),
                        new ItemStack(AppleItem.ItemID),
                        new ItemStack(GoldBlock.BlockID),
                    },
                    {
                        new ItemStack(GoldBlock.BlockID),
                        new ItemStack(GoldBlock.BlockID),
                        new ItemStack(GoldBlock.BlockID),
                    }
                };
            }
        }

        public ItemStack Output
        {
            get
            {
                return new ItemStack(ItemID);
            }
        }

        public bool SignificantMetadata
        {
            get
            {
                return true;
            }
        }
    }
}


text:
Getting Started
---------------

# Install dependencies
npm install

# Start development live-reload server
PORT=8080 npm run dev

# Start production server:
PORT=8080 npm start
```

Docker Demo
-------------------------
It's supposed to be pretty easy to take your Docker to your favourite cloud service, here's a demo of what's our Dockerized bolierplate is like: [https://docker-deployment-yudfxfiaja.now.sh/api](https://docker-deployment-yudfxfiaja.now.sh/api)

License
-------

MIT


text:
<!DOCTYPE html>

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

<link rel="shortcut icon" type="image/x-icon" href="../../../favicon.ico" />
<title>UiWatcher | Android Developers</title>

<link rel="stylesheet"
href="http://fonts.googleapis.com/css?family=Roboto:regular,medium,thin,italic,mediumitalic,bold" title="roboto">
<link href="../../../assets/css/default.css" rel="stylesheet" type="text/css">

          	Quicknav
			      Quicknav

                  Design

Develop

Distribute

Links

Google Play Developer Console

Android Developers Blog

About Android

Android Sites

Android.com

Android Developers

Android Open Source Project

      <form onsubmit="return submit_search()">
        <input id="search_autocomplete" type="text" value="" autocomplete="off" name="q"
onfocus="search_focus_changed(this, true)" onblur="search_focus_changed(this, false)"
onkeydown="return search_changed(event, true, '../../../')"
onkeyup="return search_changed(event, false, '../../../')" />
      </form>

        close

Get Started

Style

Patterns

Building Blocks

Downloads

Videos

Training

API Guides

Reference

Tools

Get the SDK

Google Services

Google Play

Publishing

Promoting

App Quality

Spotlight

Open Distribution

Results

Loading...

Training

API Guides

Reference

Tools

Google Services

to top

        Developer Tools

Download

          Setting Up the ADT Bundle

          Setting Up
    an Existing IDE

              Installing the Eclipse Plugin

            Adding Platforms and Packages

          Android Studio

              Migrating from Eclipse

              Tips and Tricks

          Exploring the SDK

Download the NDK

        Workflow

Setting Up Virtual Devices

With AVD Manager

From the Command Line

Using the Emulator

Using Hardware Devices

USB Drivers

Setting Up Projects

From Eclipse with ADT

From the Command Line

Using Code Templates

Building and Running

From Eclipse with ADT

From the Command Line

            Testing

            Fundamentals

            From Eclipse

            From Other IDEs

            Activity Testing

            Service Testing

            Content Provider Testing

            Accessibility Testing

            UI Testing

            What To Test

            Activity Testing Tutorial

Debugging

From Eclipse with ADT

From Other IDEs

Using DDMS

Reading and Writing Logs

Improving Your Code with lint

Optimizing your UI

Profiling with Traceview and dmtracedump

Analysing Display and Performance with Systrace

Investigating Your RAM Usage

Using the Dev Tools App

Publishing

Preparing for Release

Versioning Your Apps

Signing Your Apps

Support Library

Features

Setup

Tools Help

adb

ADT

android

AVD Manager

bmgr

Device Monitor

dmtracedump

Draw 9-Patch

Emulator

etc1tool

Hierarchy Viewer

hprof-conv

jobb

lint

logcat

mksdcard

monkey

monkeyrunner

MonkeyDevice

MonkeyImage

MonkeyRunner

ProGuard

SDK Manager

Systrace

Tracer for OpenGL ES

Traceview

uiautomator

Configurator

IAutomationSupport

UiAutomatorTestCase

UiCollection

UiDevice

UiObject

UiObjectNotFoundException

UiScrollable

UiSelector

UiWatcher

zipalign

Revisions

        Tools

        ADT Plugin

Platforms

Samples

      ADK

ADK 2012 Guide

ADK 2011 Guide

UiWatcher

Represents a conditional watcher on the target device. To learn how to register a conditional
 watcher, see UiDevice.registerWatcher().

Summary

Public Methods

            abstract

            boolean

        checkForCondition()

The testing framework calls this handler method automatically when the framework
        is unable to find a match using the UiSelector.

Public Methods

        public

        abstract

        boolean

      checkForCondition
      ()

The testing framework calls this handler method automatically when the framework is unable to find a match using the UiSelector. When a match is not found after a predetermined time has elapsed, the framework calls the checkForCondition() method of all registered watchers on the device. You can use this method to handle known blocking issues that are preventing the test from proceeding. For example, you can check if a dialog appeared that is blocking the the test, then close the dialog or perform some other appropriate action to allow the test to continue.

Returns

true to indicate a matched condition, or false if no matching condition is found

  Except as noted, this content is
  licensed under
  Creative Commons Attribution 2.5. For details and
  restrictions, see the Content
  License.

    About Android  |
    Legal  |
    Support


text:
package com.google.api.ads.dfp.jaxws.v201602;

import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue;
import javax.xml.bind.annotation.XmlType;

/**
 *
Java class for RichMediaStudioCreativeArtworkType.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *

 *

 * <simpleType name="RichMediaStudioCreativeArtworkType">
 *   <restriction base="{http://www.w3.org/2001/XMLSchema}string">
 *     <enumeration value="FLASH"/>
 *     <enumeration value="HTML5"/>
 *     <enumeration value="MIXED"/>
 *   </restriction>
 * </simpleType>
 *

 *
 */
@XmlType(name = "RichMediaStudioCreativeArtworkType")
@XmlEnum
public enum RichMediaStudioCreativeArtworkType {

    /**
     *
     *                 The creative is a Flash creative.
     *
     *
     */
    FLASH("FLASH"),

    /**
     *
     *                 The creative is HTML5.
     *
     *
     */
    @XmlEnumValue("HTML5")
    HTML_5("HTML5"),

    /**
     *
     *                 The creative is Flash if available, and HTML5 otherwise.
     *
     *
     */
    MIXED("MIXED");
    private final String value;

    RichMediaStudioCreativeArtworkType(String v) {
        value = v;
    }

    public String value() {
        return value;
    }

    public static RichMediaStudioCreativeArtworkType fromValue(String v) {
        for (RichMediaStudioCreativeArtworkType c: RichMediaStudioCreativeArtworkType.values()) {
            if (c.value.equals(v)) {
                return c;
            }
        }
        throw new IllegalArgumentException(v);
    }

}


text:
package org.apache.ignite.internal.processors.platform.dotnet;

import org.apache.ignite.IgniteException;
import org.apache.ignite.configuration.BinaryConfiguration;
import org.apache.ignite.configuration.CacheConfiguration;
import org.apache.ignite.configuration.IgniteConfiguration;
import org.apache.ignite.configuration.PlatformConfiguration;
import org.apache.ignite.internal.binary.BinaryMarshaller;
import org.apache.ignite.internal.binary.BinaryRawWriterEx;
import org.apache.ignite.internal.binary.BinaryReaderExImpl;
import org.apache.ignite.internal.binary.GridBinaryMarshaller;
import org.apache.ignite.internal.logger.platform.PlatformLogger;
import org.apache.ignite.internal.processors.platform.PlatformAbstractConfigurationClosure;
import org.apache.ignite.internal.processors.platform.lifecycle.PlatformLifecycleBean;
import org.apache.ignite.internal.processors.platform.memory.PlatformMemory;
import org.apache.ignite.internal.processors.platform.memory.PlatformMemoryManagerImpl;
import org.apache.ignite.internal.processors.platform.memory.PlatformOutputStream;
import org.apache.ignite.internal.processors.platform.utils.PlatformConfigurationUtils;
import org.apache.ignite.internal.processors.platform.utils.PlatformUtils;
import org.apache.ignite.internal.util.typedef.internal.U;
import org.apache.ignite.lifecycle.LifecycleBean;
import org.apache.ignite.marshaller.Marshaller;
import org.apache.ignite.platform.dotnet.PlatformDotNetAffinityFunction;
import org.apache.ignite.platform.dotnet.PlatformDotNetConfiguration;
import org.apache.ignite.platform.dotnet.PlatformDotNetLifecycleBean;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
 * Closure to apply dot net configuration.
 */
@SuppressWarnings({"UnusedDeclaration"})
public class PlatformDotNetConfigurationClosure extends PlatformAbstractConfigurationClosure {
    /** */
    private static final long serialVersionUID = 0L;

    /** Whether to use platform logger (when custom logger is defined on .NET side). */
    private final boolean useLogger;

    /** Configuration. */
    private IgniteConfiguration cfg;

    /** Memory manager. */
    private PlatformMemoryManagerImpl memMgr;

    /**
     * Constructor.
     *
     * @param envPtr Environment pointer.
     */
    public PlatformDotNetConfigurationClosure(long envPtr, boolean useLogger) {
        super(envPtr);

        this.useLogger = useLogger;
    }

    /** {@inheritDoc} */
    @SuppressWarnings("deprecation")
    @Override protected void apply0(IgniteConfiguration igniteCfg) {
        // Validate and copy Interop configuration setting environment pointer along the way.
        PlatformConfiguration interopCfg = igniteCfg.getPlatformConfiguration();

        if (interopCfg != null && !(interopCfg instanceof PlatformDotNetConfiguration))
            throw new IgniteException("Illegal platform configuration (must be of type " +
                PlatformDotNetConfiguration.class.getName() + "): " + interopCfg.getClass().getName());

        PlatformDotNetConfiguration dotNetCfg = interopCfg != null ? (PlatformDotNetConfiguration)interopCfg : null;

        if (dotNetCfg == null)
            dotNetCfg = new PlatformDotNetConfiguration();

        memMgr = new PlatformMemoryManagerImpl(gate, 1024);

        PlatformLogger logger = null;

        if (useLogger) {
            logger = new PlatformLogger();
            logger.setGateway(gate);
            igniteCfg.setGridLogger(logger);
        }

        PlatformDotNetConfigurationEx dotNetCfg0 = new PlatformDotNetConfigurationEx(dotNetCfg, gate, memMgr,
            logger);

        igniteCfg.setPlatformConfiguration(dotNetCfg0);

        // Set Ignite home so that marshaller context works.
        String ggHome = igniteCfg.getIgniteHome();

        if (ggHome != null)
            U.setIgniteHome(ggHome);

        // Callback to .Net.
        prepare(igniteCfg, dotNetCfg0);

        // Make sure binary config is right.
        setBinaryConfiguration(igniteCfg, dotNetCfg0);
    }

    /**
     * Sets binary config.
     *
     * @param igniteCfg Ignite config.
     * @param dotNetCfg .NET config.
     */
    private void setBinaryConfiguration(IgniteConfiguration igniteCfg, PlatformDotNetConfigurationEx dotNetCfg) {
        // Check marshaller.
        Marshaller marsh = igniteCfg.getMarshaller();

        if (marsh == null) {
            igniteCfg.setMarshaller(new BinaryMarshaller());

            dotNetCfg.warnings(Collections.singleton("Marshaller is automatically set to " +
                BinaryMarshaller.class.getName() + " (other nodes must have the same marshaller type)."));
        }
        else if (!(marsh instanceof BinaryMarshaller))
            throw new IgniteException("Unsupported marshaller (only " + BinaryMarshaller.class.getName() +
                " can be used when running Apache Ignite.NET): " + marsh.getClass().getName());

        BinaryConfiguration bCfg = igniteCfg.getBinaryConfiguration();
    }

    /**
     * Prepare .Net size.
     *
     * @param igniteCfg Ignite configuration.
     * @param interopCfg Interop configuration.
     */
    @SuppressWarnings("ConstantConditions")
    private void prepare(IgniteConfiguration igniteCfg, PlatformDotNetConfigurationEx interopCfg) {
        cfg = igniteCfg;

        try (PlatformMemory outMem = memMgr.allocate()) {
            try (PlatformMemory inMem = memMgr.allocate()) {
                PlatformOutputStream out = outMem.output();

                GridBinaryMarshaller marshaller = PlatformUtils.marshaller();
                BinaryRawWriterEx writer = marshaller.writer(out);

                PlatformConfigurationUtils.writeDotNetConfiguration(writer, interopCfg.unwrap());

                // Write .NET beans
                List<PlatformDotNetLifecycleBean> beans = beans(igniteCfg);

                writer.writeInt(beans.size());

                for (PlatformDotNetLifecycleBean bean : beans) {
                    writer.writeString(bean.getTypeName());
                    writer.writeMap(bean.getProperties());
                }

                // Write .NET affinity functions
                List<PlatformDotNetAffinityFunction> affFuncs = affinityFunctions(igniteCfg);

                writer.writeInt(affFuncs.size());

                for (PlatformDotNetAffinityFunction func : affFuncs) {
                    writer.writeString(func.getTypeName());
                    writer.writeMap(func.getProperties());
                }

                out.synchronize();

                gate.extensionCallbackInLongLongOutLong(
                    PlatformUtils.OP_PREPARE_DOT_NET, outMem.pointer(), inMem.pointer());

                processPrepareResult(marshaller.reader(inMem.input()));
            }
        }
    }

    /**
     * Process prepare result.
     *
     * @param in Input stream.
     */
    private void processPrepareResult(BinaryReaderExImpl in) {
        assert cfg != null;

        PlatformConfigurationUtils.readIgniteConfiguration(in, cfg);

        // Process beans
        List<PlatformDotNetLifecycleBean> beans = beans(cfg);
        List<PlatformLifecycleBean> newBeans = new ArrayList<>();

        int len = in.readInt();

        for (int i = 0; i < len; i++) {
            if (i < beans.size())
                // Existing bean.
                beans.get(i).initialize(gate, in.readLong());
            else
                // This bean is defined in .Net.
                newBeans.add(new PlatformLifecycleBean(gate, in.readLong()));
        }

        if (!newBeans.isEmpty()) {
            LifecycleBean[] newBeans0 = newBeans.toArray(new LifecycleBean[newBeans.size()]);

            // New beans were added. Let's append them to the tail of the rest configured lifecycle beans.
            LifecycleBean[] oldBeans = cfg.getLifecycleBeans();

            if (oldBeans == null)
                cfg.setLifecycleBeans(newBeans0);
            else {
                LifecycleBean[] mergedBeans = new LifecycleBean[oldBeans.length + newBeans.size()];

                System.arraycopy(oldBeans, 0, mergedBeans, 0, oldBeans.length);
                System.arraycopy(newBeans0, 0, mergedBeans, oldBeans.length, newBeans0.length);

                cfg.setLifecycleBeans(mergedBeans);
            }
        }

        // Process affinity functions
        List<PlatformDotNetAffinityFunction> affFuncs = affinityFunctions(cfg);

        if (!affFuncs.isEmpty()) {
            for (PlatformDotNetAffinityFunction aff : affFuncs)
                aff.init(PlatformConfigurationUtils.readAffinityFunction(in));
        }
    }

    /**
     * Find .Net lifecycle beans in configuration.
     *
     * @param cfg Configuration.
     * @return Beans.
     */
    private static List<PlatformDotNetLifecycleBean> beans(IgniteConfiguration cfg) {
        List<PlatformDotNetLifecycleBean> res = new ArrayList<>();

        if (cfg.getLifecycleBeans() != null) {
            for (LifecycleBean bean : cfg.getLifecycleBeans()) {
                if (bean instanceof PlatformDotNetLifecycleBean)
                    res.add((PlatformDotNetLifecycleBean)bean);
            }
        }

        return res;
    }

    /**
     * Find .NET affinity functions in configuration.
     *
     * @param cfg Configuration.
     * @return affinity functions.
     */
    private static List<PlatformDotNetAffinityFunction> affinityFunctions(IgniteConfiguration cfg) {
        List<PlatformDotNetAffinityFunction> res = new ArrayList<>();

        CacheConfiguration[] cacheCfg = cfg.getCacheConfiguration();

        if (cacheCfg != null) {
            for (CacheConfiguration ccfg : cacheCfg) {
                if (ccfg.getAffinity() instanceof PlatformDotNetAffinityFunction)
                    res.add((PlatformDotNetAffinityFunction)ccfg.getAffinity());
            }
        }

        return res;
    }
}


text:
package org.apache.commons.digester3.xmlrules;

import java.util.Stack;

/**
 */
final class PatternStack
    extends Stack<String>
{

    private static final long serialVersionUID = 1L;

    @Override
    public String toString()
    {
        final StringBuilder strBuilder = new StringBuilder();
        for ( int i = 0; i < size(); i++ )
        {
            final String elem = get( i );
            if ( !elem.isEmpty() )
            {
                if ( strBuilder.length() > 0 )
                {
                    strBuilder.append( '/' );
                }
                strBuilder.append( elem );
            }
        }
        return strBuilder.toString();
    }

}


text:
typedef struct fs_filter_data_s {
    bool (*parentFilter)(void* data, const char* name, u32 attributes);
    void* parentFilterData;
} fs_filter_data;

bool fs_is_dir(FS_Archive archive, const char* path);
Result fs_ensure_dir(FS_Archive archive, const char* path);

FS_Path fs_make_path_binary(const void* data, u32 size);
FS_Path* fs_make_path_utf8(const char* path);
void fs_free_path_utf8(FS_Path* path);

Result fs_open_archive(FS_Archive* archive, FS_ArchiveID id, FS_Path path);
Result fs_ref_archive(FS_Archive archive);
Result fs_close_archive(FS_Archive archive);

const char* fs_get_3dsx_path();
void fs_set_3dsx_path(const char* path);

int fs_make_3dsx_path(char* out, const char* name, size_t size);
int fs_make_smdh_path(char* out, const char* name, size_t size);

FS_MediaType fs_get_title_destination(u64 titleId);

bool fs_filter_cias(void* data, const char* name, u32 attributes);
bool fs_filter_tickets(void* data, const char* name, u32 attributes);


text:
package com.alsash.reciper.mvp.view;

import com.alsash.reciper.mvp.model.entity.Food;

/**
 * SingleSelection dialog with list view
 */
public interface RecipeDialogIngredientView extends BaseSelectionDialogView<Food> {
}


text:
<?xml version="1.0" ?>

<container xmlns="http://symfony.com/schema/dic/services"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">

    <parameters>
        <parameter key="templating.asset.path_package.class">Symfony\Bundle\FrameworkBundle\Templating\Asset\PathPackage</parameter>
        <parameter key="templating.asset.url_package.class">Symfony\Component\Templating\Asset\UrlPackage</parameter>
        <parameter key="templating.asset.package_factory.class">Symfony\Bundle\FrameworkBundle\Templating\Asset\PackageFactory</parameter>
    </parameters>

    <services>
        <service id="templating.asset.path_package" class="%templating.asset.path_package.class%" abstract="true">
            <argument type="service" id="request" />
            <argument /> <!-- version -->
            <argument /> <!-- version format -->
        </service>

        <service id="templating.asset.url_package" class="%templating.asset.url_package.class%" abstract="true">
            <argument /> <!-- base urls -->
            <argument /> <!-- version -->
            <argument /> <!-- version format -->
        </service>

        <service id="templating.asset.request_aware_package" class="Symfony\Component\Templating\Asset\PackageInterface" abstract="true">
            <factory service="templating.asset.package_factory" method="getPackage" />
            <argument type="service" id="request" strict="false" />
            <argument /> <!-- HTTP id -->
            <argument /> <!-- SSL id -->
        </service>

        <service id="templating.asset.package_factory" class="%templating.asset.package_factory.class%">
            <argument type="service" id="service_container" />
        </service>
    </services>
</container>


text:
require 'find'
#
# QuickServe::Listener
#
# The generic Listener, which polls the files after a specific interval
#
module QuickServe
  module Rails
    class Listener
        attr_accessor :files, :interval

        # constructor
        def initialize
          self.interval = 2 # decrease the CPU load by increasing the interval
        end

        # find files and start the listener
        def start
          puts "** quick_serve: scanning for files... "
          # build a file collection
          find_files
          puts "** quick_serve: watching #{files.size} files for changes... "
          wait
        end

        # wait for a specified interval and check files for changes
        # source: ZenTest/autotest.rb
        def wait
          Kernel.sleep self.interval until check_files
        end

        # check files to find these that have changed
        def check_files
          updated = []
          files.each do |filename, mtime|
            begin
              current_mtime = File.stat(filename).mtime
            rescue Errno::ENOENT
              # file was not found and was probably deleted
              # remove the file from the file list
              files.delete(filename)
              next
            end
            if current_mtime != mtime
              updated << filename
              # update the mtime in file registry so we it's only send once
              files[filename] = current_mtime
              puts "quick_serve: spotted change in #{filename}"
            end
          end
          QuickServe::Rails::Snapshot.reset if updated != []
          false
        end

        ##
        # Find the files to process, ignoring temporary files, source
        # configuration management files, etc., and return a Hash mapping
        # filename to modification time.
        # source: ZenTest/autotest.rb
        def find_files
          result = {}
          targets = ['app'] # start simple
          targets.each do |target|
            order = []
            Find.find(target) do |f|
              next if test ?d, f
              next if f =~ /(swp|~|rej|orig)$/ # temporary/patch files
              next if f =~ /(\.svn|\.git)$/ # subversion/git
              next if f =~ /\/\.?#/ # Emacs autosave/cvs merge files
              filename = f.sub(/^\.\//, '')

              result[filename] = File.stat(filename).mtime rescue next
            end
          end

          self.files = result
        end

    end
  end
end


text: obj-$(CONFIG_SAMPLE_RPMSG_CLIENT) += rpmsg_client_sample.o


text:
@Components(family = "demo")
@Icon(Icon.IconType.DEFAULT)
package org.talend.test.valid.datasetintwosourceswithonewithadditionalrequired;

import org.talend.sdk.component.api.component.Components;
import org.talend.sdk.component.api.component.Icon;


text:
/**
 * @file  rodsDef.h
 *
 */

/*** Copyright (c), The Regents of the University of California            ***
 *** For more information please refer to files in the COPYRIGHT directory ***/

/* rodsdef.h - common header file for rods
 */

#ifndef RODS_DEF_H__
#define RODS_DEF_H__

#include <stdio.h>
#include <errno.h>
#if defined(solaris_platform)
#include <fcntl.h>
#endif
#include <ctype.h>
#include <sys/stat.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#include <signal.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/types.h>

#if defined(solaris_platform)
#include <arpa/inet.h>
#endif

#ifndef _WIN32
#include <sys/socket.h>
#include <netinet/in.h>
#include <sys/file.h>
#include <unistd.h>
#include <dirent.h>
#include <time.h>
#include <sys/param.h>
#include <pwd.h>
#include <grp.h>
#include <netdb.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
#endif

#define HEADER_TYPE_LEN 128 /* changed by Raja to 128 from 16 */
#define TIME_LEN        32
#define NAME_LEN        64
#define CHKSUM_LEN      64  /* keep chksum_len the same as the old size */
#define LONG_NAME_LEN	256
#define MAX_PATH_ALLOWED 1024
/* MAX_NAME_LEN actually has space for a few extra characters to match
   the way it is often used in the code. */
#define MAX_NAME_LEN   (MAX_PATH_ALLOWED+64)
#define HUGE_NAME_LEN 100000

/* increase to 20K because the French Lib rules are very long */
#define META_STR_LEN  (1024*20)

#define SHORT_STR_LEN 32  /* for dataMode, perhaps others */

#ifndef NULL
#define NULL    0
#endif

#define PTR_ARRAY_MALLOC_LEN    10	/* the len to allocate each time */

/* definition for the global variable int ProcessType */

#define CLIENT_PT	0	/* client process type */
#define SERVER_PT	1	/* server process type */
#define AGENT_PT	2	/* agent process type */
#define RE_SERVER_PT	3	/* reServer type */
#define XMSG_SERVER_PT	4	/* xmsgServer type */

/* definition for rcat type */

#define MASTER_RCAT	0
#define SLAVE_RCAT	1
#define INIT_SZ_FOR_EXECMD_BUF     (16*1024)
#define MAX_SZ_FOR_EXECMD_BUF     (1*1024*1024)
#define MIN_SZ_FOR_PARA_TRAN     (1*1024*1024)
#define TRANS_SZ        (40*1024*1024)
#define LARGE_SPACE     1000000000
#define UNKNOWN_FILE_SZ	-99	/* value to indicate the file sz is unknown */
#define MIN_RESTART_SIZE	(64*1024*1024)
#define RESTART_FILE_UPDATE_SIZE  (32*1024*1024)

#define MAX_NUM_CONFIG_TRAN_THR        64

/* definition for numThreads input */

#define NO_THREADING	-1
#define AUTO_THREADING   0	/* default */

#define NO_SAVE_REI  0
#define SAVE_REI  1

#define SELECT_TIMEOUT_FOR_CONN	60	/* 60 sec wait for connection */
/* this is the return value for the rcExecMyRule call indicating the
 * server is requesting the client to client to perform certain task */
#define SYS_SVR_TO_CLI_MSI_REQUEST 99999995
#define SYS_SVR_TO_CLI_COLL_STAT 99999996
#define SYS_CLI_TO_SVR_COLL_STAT_REPLY 99999997
#define SYS_SVR_TO_CLI_PUT_ACTION 99999990
#define SYS_SVR_TO_CLI_GET_ACTION 99999991
#define SYS_RSYNC_TARGET_MODIFIED 99999992	/* target modified */

/* definition for iRODS server to client action request from a microservice.
 * these definitions are put in the "label" field of MsParam */

#define CL_PUT_ACTION	"CL_PUT_ACTION"
#define CL_GET_ACTION	"CL_GET_ACTION"
#define CL_ZONE_OPR_INX	"CL_ZONE_OPR_INX"

/* the following defines the RSYNC_MODE_KW */
#define LOCAL_TO_IRODS	"LOCAL_TO_IRODS"
#define IRODS_TO_LOCAL	"IRODS_TO_LOCAL"
#define IRODS_TO_IRODS	"IRODS_TO_IRODS"
#define IRODS_TO_COLLECTION	"IRODS_TO_COLLECTION"

/* definition for public user */
#define PUBLIC_USER_NAME	"public"

/* definition for anonymous user */
#define ANONYMOUS_USER "anonymous"

/* definition for bulk operation */
#define MAX_NUM_BULK_OPR_FILES	50
#define MAX_BULK_OPR_FILE_SIZE  (4*1024*1024)
#define BULK_OPR_BUF_SIZE	(8*MAX_BULK_OPR_FILE_SIZE)
#define TAR_OVERHEAD		(MAX_NUM_BULK_OPR_FILES * MAX_NAME_LEN * 2)

/* generic return value for policy rules */
#define POLICY_OFF	0
#define POLICY_ON	1

/* protocol */
typedef enum {
    NATIVE_PROT,
    XML_PROT
} irodsProt_t;

/* myRead/myWrite type */

typedef enum {
    SOCK_TYPE,
    FILE_DESC_TYPE
} irodsDescType_t;

/* position for queuing */
typedef enum {
    BOTTOM_POS,
    TOP_POS
} irodsPosition_t;

typedef enum {
    UNINIT_STATE,
    OFF_STATE,
    ON_STATE
} irodsStateFlag_t;

typedef enum {
    NOT_ORPHAN_PATH,
    IS_ORPHAN_PATH,
    is_ORPHAN_HOME
} orphanPathType_t;

#define DEF_IRODS_PROT	NATIVE_PROT

/**
 * \var bytesBuf_t
 * \brief  general struct to store a buffer of bytes
 * \since 1.0
 *
 * \ingroup capi_input_data_structures
 *
 * \remark none
 *
 * \note
 * Elements of bytesBuf_t:
 * \li int len - the length of the allocated buffer in buf or the length of
 *        the data stored in buf depending on the application.
 * \li void *buf - pointer to the buffer.
 *
 * \sa none
 */

typedef struct BytesBuf {   /* have to add BytesBuf to get Doxygen working */
    int len;	/* len in bytes in buf */
    void *buf;
} bytesBuf_t;

typedef struct {   /* have to add BytesBuf to get Doxygen working */
    int type;
    int len;    /* len of array in buf */
    void *buf;
} dataArray_t;

/* The msg header for all communication between client and server */

typedef struct msgHeader {
    char type[HEADER_TYPE_LEN];
    int msgLen;     /* Length of the main msg */
    int errorLen;   /* Length of the error struct */
    int bsLen;      /* Length of optional byte stream */
    int intInfo;    /* an additional integer info, for API, it is the
			 * apiReqNum */
} msgHeader_t;

/* header length XML tag */
#define MSG_HEADER_LEN_TAG	"MsgHeaderLen"

/* msg type */
#define RODS_CONNECT_T    "RODS_CONNECT"
#define RODS_VERSION_T    "RODS_VERSION"
#define RODS_API_REQ_T    "RODS_API_REQ"
#define RODS_DISCONNECT_T    "RODS_DISCONNECT"
#define RODS_RECONNECT_T    "RODS_RECONNECT"
#define RODS_REAUTH_T     "RODS_REAUTH"
#define RODS_API_REPLY_T    "RODS_API_REPLY"
#define RODS_CS_NEG_T    "RODS_CS_NEG_T"

/* The strct sent with RODS_CONNECT type by client */
typedef struct startupPack {
    irodsProt_t irodsProt;
    int reconnFlag;
    int connectCnt;
    char proxyUser[NAME_LEN];
    char proxyRodsZone[NAME_LEN];
    char clientUser[NAME_LEN];
    char clientRodsZone[NAME_LEN];
    char relVersion[NAME_LEN];
    char apiVersion[NAME_LEN];
    char option[LONG_NAME_LEN];
} startupPack_t;

/* env variable for the client protocol */
#define IRODS_PROT	"irodsProt"

/* env variable for the startup pack */

#define SP_NEW_SOCK	"spNewSock"
#define SP_CLIENT_ADDR	"spClientAddr"
#define SP_CONNECT_CNT	"spConnectCnt"
#define SP_PROTOCOL	"spProtocol"
#define SP_RECONN_FLAG	"spReconnFlag"
#define SP_PROXY_USER	"spProxyUser"
#define SP_PROXY_RODS_ZONE "spProxyRodsZone"
#define SP_CLIENT_USER	"spClientUser"
#define SP_CLIENT_RODS_ZONE "spClientRodsZone"
#define SP_REL_VERSION	"spRelVersion"
#define SP_API_VERSION	"spApiVersion"
#define SP_OPTION	"spOption"
#define SP_LOG_SQL	"spLogSql"
#define SP_LOG_LEVEL	"spLogLevel"
#define SP_RE_CACHE_SALT "reCacheSalt"
#define SERVER_BOOT_TIME "serverBootTime"

// =-=-=-=-=-=-=-
// magic token to assign to startup pack option variable
// in order to request a client-server negotiation
#define REQ_SVR_NEG	"request_server_negotiation"

/* Definition for resource status. If it is empty (strlen == 0), it is
 * assumed to be up */
#define RESC_DOWN	"down"
#define RESC_UP		"up"
#define RESC_AUTO_UP	"auto-up"
#define RESC_AUTO_DOWN	"auto-down"

#define  INT_RESC_STATUS_UP 	0
#define  INT_RESC_STATUS_DOWN 	1

/* The strct sent with RODS_VERSION type by server */

typedef struct {
    int status;		/* if > 0, contains the reconnection port */
    char relVersion[NAME_LEN];
    char apiVersion[NAME_LEN];
    int reconnPort;
    char reconnAddr[LONG_NAME_LEN];
    int cookie;
} version_t;
/* struct that defines a Host Addr */

typedef struct {
    char hostAddr[LONG_NAME_LEN];
    char zoneName[NAME_LEN];
    int portNum;
    int dummyInt;	/* make it to 64 bit boundary */
} rodsHostAddr_t;

/* definition for restartState */

#define PATH_MATCHING		0x1
#define LAST_PATH_MATCHED	0x2
#define MATCHED_RESTART_COLL    0x4
#define OPR_RESUMED    		0x8

/* definition for DNN WOS connection env */

#define WOS_HOST_ENV    "wosHost"
#define WOS_POLICY_ENV  "wosPolicy"

/* struct that defines restart operation */

typedef struct {
    char restartFile[MAX_NAME_LEN];
    int fd;		/* df of the opened restartFile */
    int doneCnt;	/* a count of number of files done in the coll/dir */
    char collection[MAX_NAME_LEN];      /* the coll/dir being restarted */
    char lastDonePath[MAX_NAME_LEN];	/* the last path that is done */
    char oprType[NAME_LEN];	/* BULK_OPR_KW or NON_BULK_OPR_KW */
    int curCnt;
    int restartState;
} rodsRestart_t;

/* definition for handler function */
#ifdef __cplusplus
typedef int( ( *funcPtr )( ... ) );
#else
typedef int( ( *funcPtr )( ) );
#endif

/* some platform does not support vfork */
#if defined(sgi_platform) || defined(aix_platform)
#define RODS_FORK() fork()
#else
#define RODS_FORK() vfork()
#endif

#define VAULT_PATH_POLICY	"VAULT_PATH_POLICY"	/* msParam lable */
/* definition for vault filePath scheme */
typedef enum {
    GRAFT_PATH_S,
    RANDOM_S
} vaultPathScheme_t;

#define DEF_VAULT_PATH_SCHEME	GRAFT_PATH_S
#define DEF_ADD_USER_FLAG	1
#define DEF_TRIM_DIR_CNT	1

typedef struct {
    vaultPathScheme_t scheme;
    int addUserName;
    int trimDirCnt;	/* for GRAFT_PATH_S only. Number of directories to
			 * trim */
} vaultPathPolicy_t;

/* struct for proc (agent) logging */
typedef struct {
    int pid;
    unsigned int startTime;
    char clientName[NAME_LEN];
    char clientZone[NAME_LEN];
    char proxyName[NAME_LEN];
    char proxyZone[NAME_LEN];
    char remoteAddr[NAME_LEN];
    char serverAddr[NAME_LEN];
    char progName[NAME_LEN];
} procLog_t;

#endif	// RODS_DEF_H__


text:
<?xml version="1.0" encoding="UTF-8"?>

<screens xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/widget-screen.xsd">

    <screen name="EditMarketingCampaign">

            <actions>
                <set field="activeSubMenuItem" value="MarketingCampaign"/>
                <property-map resource="MarketingUiLabels" map-name="uiLabelMap" global="true"/>
                <set field="marketingCampaignId" from-field="parameters.marketingCampaignId" />
                <set field="title" value="${uiLabelMap.MarketingCampaign} ${marketingCampaignId}" />
                <entity-one entity-name="MarketingCampaign" value-field="marketingCampaign" />
            </actions>
            <widgets>
                <decorator-screen name="CommonMarketingDecorator" location="${parameters.mainDecoratorLocation}">
                    <decorator-section name="body">

                            <condition>
                                <not><if-empty field="marketingCampaign" /></not>
                            </condition>

                        <include-form name="EditMarketingCampaign" location="component://marketing/widget/MarketingCampaignForms.xml" />
                    </decorator-section>
                </decorator-screen>
            </widgets>

    </screen>

    <screen name="FindMarketingCampaign">

            <actions>
                <set field="activeSubMenuItem" value="MarketingCampaign"/>
                <property-map resource="MarketingUiLabels" map-name="uiLabelMap" global="true"/>
                <set field="marketingCampaignId" from-field="parameters.marketingCampaignId" />
                <set field="entityName" value="MarketingCampaign" />
                <set field="title" value="${uiLabelMap.MarketingCampaign} ${marketingCampaignId}" />
                <set field="showActionButtons" value="Y" />
            </actions>
            <widgets>
                <decorator-screen name="CommonMarketingDecorator" location="${parameters.mainDecoratorLocation}">
                    <decorator-section name="body">

                            <condition>
                                 <if-has-permission permission="MARKETING" action="_CREATE"/>
                            </condition>
                            <widgets>
                                <decorator-screen name="FindScreenDecorator" location="component://common/widget/CommonScreens.xml">
                                    <decorator-section name="menu-bar">
                                        <container style="button-bar"><link text="${uiLabelMap.MarketingCampaignCreate}" target="EditMarketingCampaign" style="${styles.link_nav} ${styles.action_add}"/></container>
                                    </decorator-section>
                                    <decorator-section name="search-options">
                                        <platform-specific></platform-specific>
                                    </decorator-section>
                                    <decorator-section name="search-results">
                                        <include-screen name="MarketingCampaignSearchResults"/>
                                    </decorator-section>
                                </decorator-screen>
                            </widgets>

                    </decorator-section>
                </decorator-screen>
            </widgets>

    </screen>

    <screen name="MarketingCampaignSearchResults">

            <actions>


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Dynamic;
using Umbraco.Core;
using Umbraco.Core.Dynamics;
using System.Collections;
using System.Reflection;
using Umbraco.Core.Models;
using Umbraco.Core.Models.PublishedContent;
using Umbraco.Web.Dynamics;

namespace Umbraco.Web.Models
{
    /// <summary>
    /// Represents a collection of DynamicPublishedContent items.
    /// </summary>
    public class DynamicPublishedContentList : DynamicObject, IEnumerable<DynamicPublishedContent>
    {
        private readonly List<IPublishedContent> _content;
        private readonly PublishedContentSet<IPublishedContent> _contentSet;
        internal readonly List<DynamicPublishedContent> Items;

        #region Constructor

        public DynamicPublishedContentList()
        {
            _content = new List<IPublishedContent>();
            _contentSet = new PublishedContentSet<IPublishedContent>(_content);
            Items = new List<DynamicPublishedContent>();
        }

        public DynamicPublishedContentList(IEnumerable<IPublishedContent> items)
        {
            _content = items.ToList();
            _contentSet = new PublishedContentSet<IPublishedContent>(_content);
            Items = _contentSet.Select(x => new DynamicPublishedContent(x, this)).ToList();
        }

        public DynamicPublishedContentList(IEnumerable<DynamicPublishedContent> items)
        {
            _content = items.Select(x => x.PublishedContent).ToList();
            _contentSet = new PublishedContentSet<IPublishedContent>(_content);
            Items = _contentSet.Select(x => new DynamicPublishedContent(x, this)).ToList();
        }

        #endregion

        #region ContentSet

        // so we are ~compatible with strongly typed syntax
        public DynamicPublishedContentList ToContentSet()
        {
            return this;
        }

        #endregion

        #region IList (well, part of it)

        /// <summary>
        /// Adds an item to the collection.
        /// </summary>
        /// <param name="dynamicContent">The item to add.</param>
        public void Add(DynamicPublishedContent dynamicContent)
        {
            var content = dynamicContent.PublishedContent;
            _content.Add(content);
            _contentSet.SourceChanged();

            var setContent = _contentSet.MapContent(content);
            Items.Add(new DynamicPublishedContent(setContent, this));
        }

        /// <summary>
        /// Removes an item from the collection.
        /// </summary>
        /// <param name="dynamicContent">The item to remove.</param>
        public void Remove(DynamicPublishedContent dynamicContent)
        {
            if (Items.Contains(dynamicContent) == false) return;
            Items.Remove(dynamicContent);
            _content.Remove(dynamicContent.PublishedContent);
            _contentSet.SourceChanged();
        }

        #endregion

        #region DynamicObject

        // because we want to return DynamicNull and not null, we need to implement the index property
        // via the dynamic getter and not natively - otherwise it's not possible to return DynamicNull

        public override bool TryGetIndex(GetIndexBinder binder, object[] indexes, out object result)
        {
            result = DynamicNull.Null;

            if (indexes.Length != 1)
                return false;

            var index = indexes[0] as int?;
            if (index.HasValue == false)
                return false;

            if (index >= 0 && index < Items.Count)
                result = Items[index.Value];

            return true;
        }

        public override bool TryInvokeMember(InvokeMemberBinder binder, object[] args, out object result)
        {
			//TODO: Nowhere here are we checking if args is the correct length!

			//NOTE: For many of these we could actually leave them out since we are executing custom extension methods and because
			// we implement IEnumerable<T> they will execute just fine, however, to do that will be quite a bit slower than checking here.

			var firstArg = args.FirstOrDefault();
			//this is to check for 'DocumentTypeAlias' vs 'NodeTypeAlias' for compatibility
			if (firstArg != null && firstArg.ToString().InvariantStartsWith("NodeTypeAlias"))
			{
				firstArg = "DocumentTypeAlias" + firstArg.ToString().Substring("NodeTypeAlias".Length);
			}

            var name = binder.Name;
			if (name == "Single")
			{
				string predicate = firstArg == null ? "" : firstArg.ToString();
				var values = predicate.IsNullOrWhiteSpace() ? new object[] {} : args.Skip(1).ToArray();
				var single = Single<DynamicPublishedContent>(predicate, values);
				result = new DynamicPublishedContent(single);
				return true;
			}
			if (name == "SingleOrDefault")
			{
				string predicate = firstArg == null ? "" : firstArg.ToString();
				var values = predicate.IsNullOrWhiteSpace() ? new object[] { } : args.Skip(1).ToArray();
				var single = SingleOrDefault<DynamicPublishedContent>(predicate, values);
				if (single == null)
                    result = DynamicNull.Null;
				else
					result = new DynamicPublishedContent(single);
				return true;
			}
			if (name == "First")
			{
				string predicate = firstArg == null ? "" : firstArg.ToString();
				var values = predicate.IsNullOrWhiteSpace() ? new object[] { } : args.Skip(1).ToArray();
				var first = First<DynamicPublishedContent>(predicate, values);
				result = new DynamicPublishedContent(first);
				return true;
			}
			if (name == "FirstOrDefault")
			{
				string predicate = firstArg == null ? "" : firstArg.ToString();
				var values = predicate.IsNullOrWhiteSpace() ? new object[] { } : args.Skip(1).ToArray();
				var first = FirstOrDefault<DynamicPublishedContent>(predicate, values);
				if (first == null)
                    result = DynamicNull.Null;
				else
					result = new DynamicPublishedContent(first);
				return true;
			}
			if (name == "Last")
			{
				string predicate = firstArg == null ? "" : firstArg.ToString();
				var values = predicate.IsNullOrWhiteSpace() ? new object[] { } : args.Skip(1).ToArray();
				var last = Last<DynamicPublishedContent>(predicate, values);
				result = new DynamicPublishedContent(last);
				return true;
			}
			if (name == "LastOrDefault")
			{
				string predicate = firstArg == null ? "" : firstArg.ToString();
				var values = predicate.IsNullOrWhiteSpace() ? new object[] { } : args.Skip(1).ToArray();
				var last = LastOrDefault<DynamicPublishedContent>(predicate, values);
				if (last == null)
                    result = DynamicNull.Null;
				else
					result = new DynamicPublishedContent(last);
				return true;
			}
            if (name == "Where")
            {
				string predicate = firstArg.ToString();
                var values = args.Skip(1).ToArray();
				//TODO: We are pre-resolving the where into a ToList() here which will have performance impacts if there where clauses
				// are nested! We should somehow support an QueryableDocumentList!
				result = new DynamicPublishedContentList(Where<DynamicPublishedContent>(predicate, values).ToList());
                return true;
            }
            if (name == "OrderBy")
            {
				//TODO: We are pre-resolving the where into a ToList() here which will have performance impacts if there where clauses
				// are nested! We should somehow support an QueryableDocumentList!
				result = new DynamicPublishedContentList(OrderBy<DynamicPublishedContent>(firstArg.ToString()).ToList());
                return true;
            }
			if (name == "Take")
			{
				result = new DynamicPublishedContentList(this.Take<DynamicPublishedContent>((int)firstArg));
				return true;
			}
			if (name == "Skip")
			{
                result = new DynamicPublishedContentList(this.Skip<DynamicPublishedContent>((int)firstArg));
				return true;
			}
        	if (name == "InGroupsOf")
            {
                int groupSize;
				if (int.TryParse(firstArg.ToString(), out groupSize))
                {
                    result = InGroupsOf(groupSize);
                    return true;
                }
                result = DynamicNull.Null;
                return true;
            }
            if (name == "GroupedInto")
            {
                int groupCount;
				if (int.TryParse(firstArg.ToString(), out groupCount))
                {
                    result = GroupedInto(groupCount);
                    return true;
                }
                result = DynamicNull.Null;
                return true;
            }
            if (name == "GroupBy")
            {
				result = GroupBy(firstArg.ToString());
                return true;
            }
            if (name == "Average" || name == "Min" || name == "Max" || name == "Sum")
            {
                result = Aggregate(args, name);
                return true;
            }
            if (name == "Union")
            {
                // check DynamicPublishedContentList before IEnumerable<...> because DynamicPublishedContentList
                // is IEnumerable<...> so ... the check on DynamicPublishedContentList would never be reached.

                var firstArgAsDynamicPublishedContentList = firstArg as DynamicPublishedContentList;
                if (firstArgAsDynamicPublishedContentList != null)
                {
                    result = new DynamicPublishedContentList(Items.Union((firstArgAsDynamicPublishedContentList).Items));
                    return true;
                }

                var firstArgAsIEnumerable = firstArg as IEnumerable<DynamicPublishedContent>;
                if (firstArgAsIEnumerable != null)
                {
                    result = new DynamicPublishedContentList(Items.Union(firstArgAsIEnumerable));
                    return true;
                }
            }
            if (name == "Except")
            {
				if ((firstArg as IEnumerable<DynamicPublishedContent>) != null)
                {
					result = new DynamicPublishedContentList(Items.Except(firstArg as IEnumerable<DynamicPublishedContent>, new DynamicPublishedContentIdEqualityComparer()));
                    return true;
                }
            }
            if (name == "Intersect")
            {
				if ((firstArg as IEnumerable<DynamicPublishedContent>) != null)
                {
					result = new DynamicPublishedContentList(Items.Intersect(firstArg as IEnumerable<DynamicPublishedContent>, new DynamicPublishedContentIdEqualityComparer()));
                    return true;
                }
            }
            if (name == "Distinct")
            {
                result = new DynamicPublishedContentList(Items.Distinct(new DynamicPublishedContentIdEqualityComparer()));
                return true;
            }
            if (name == "Pluck" || name == "Select")
            {
                result = Pluck(args);
                return true;
            }

			//ok, now lets try to match by member, property, extensino method
			var attempt = DynamicInstanceHelper.TryInvokeMember(this, binder, args, new[]
				{
					typeof (IEnumerable<DynamicPublishedContent>),
					typeof (DynamicPublishedContentList)
				});

			if (attempt.Success)
			{
				result = attempt.Result.ObjectResult;

				//need to check the return type and possibly cast if result is from an extension method found
				if (attempt.Result.Reason == DynamicInstanceHelper.TryInvokeMemberSuccessReason.FoundExtensionMethod)
				{
					//we don't need to cast if the result is already DynamicPublishedContentList
					if (attempt.Result.ObjectResult != null && (!(attempt.Result.ObjectResult is DynamicPublishedContentList)))
					{
						if (attempt.Result.ObjectResult is IPublishedContent)
						{
							result = new DynamicPublishedContent((IPublishedContent)attempt.Result.ObjectResult);
						}
						else if (attempt.Result.ObjectResult is IEnumerable<DynamicPublishedContent>)
						{
							result = new DynamicPublishedContentList((IEnumerable<DynamicPublishedContent>)attempt.Result.ObjectResult);
						}
						else if (attempt.Result.ObjectResult is IEnumerable<IPublishedContent>)
						{
							result = new DynamicPublishedContentList((IEnumerable<IPublishedContent>)attempt.Result.ObjectResult);
						}
					}
				}
				return true;
			}

			//this is the result of an extension method execution gone wrong so we return dynamic null
			if (attempt.Result.Reason == DynamicInstanceHelper.TryInvokeMemberSuccessReason.FoundExtensionMethod
				&& attempt.Exception != null && attempt.Exception is TargetInvocationException)
			{
                result = DynamicNull.Null;
				return true;
			}

			result = null;
			return false;

        }

        #endregion

        #region Linq and stuff

        private T Aggregate<T>(IEnumerable<T> data, string name) where T : struct
        {
            switch (name)
            {
                case "Min":
                    return data.Min<T>();
                case "Max":
                    return data.Max<T>();
                case "Average":
                    if (typeof(T) == typeof(int))
                    {
                        return (T)Convert.ChangeType((data as List<int>).Average(), typeof(T));
                    }
                    if (typeof(T) == typeof(decimal))
                    {
                        return (T)Convert.ChangeType((data as List<decimal>).Average(), typeof(T));
                    }
                    break;
                case "Sum":
                    if (typeof(T) == typeof(int))
                    {
                        return (T)Convert.ChangeType((data as List<int>).Sum(), typeof(T));
                    }
                    if (typeof(T) == typeof(decimal))
                    {
                        return (T)Convert.ChangeType((data as List<decimal>).Sum(), typeof(T));
                    }
                    break;
            }
            return default(T);
        }
        private object Aggregate(object[] args, string name)
        {
            object result;
            string predicate = args.First().ToString();
            var values = args.Skip(1).ToArray();
            var query = (IQueryable<object>)this.Select(predicate, values);
            object firstItem = query.FirstOrDefault();
            if (firstItem == null)
            {
                result = DynamicNull.Null;
            }
            else
            {
                var types = from i in query
                            group i by i.GetType() into g
                            where g.Key != typeof(DynamicNull)
                            orderby g.Count() descending
                            select new { g, Instances = g.Count() };
                var dominantType = types.First().g.Key;
                //remove items that are not the dominant type
                //e.g. string,string,string,string,false[DynamicNull],string
                var itemsOfDominantTypeOnly = query.ToList();
                itemsOfDominantTypeOnly.RemoveAll(item => !item.GetType().IsAssignableFrom(dominantType));
                if (dominantType == typeof(string))
                {
                    throw new ArgumentException("Can only use aggregate methods on properties which are numeric");
                }
                else if (dominantType == typeof(int))
                {
                    List<int> data = (List<int>)itemsOfDominantTypeOnly.Cast<int>().ToList();
                    return Aggregate<int>(data, name);
                }
                else if (dominantType == typeof(decimal))
                {
                    List<decimal> data = (List<decimal>)itemsOfDominantTypeOnly.Cast<decimal>().ToList();
                    return Aggregate<decimal>(data, name);
                }
                else if (dominantType == typeof(bool))
                {
                    throw new ArgumentException("Can only use aggregate methods on properties which are numeric or datetime");
                }
                else if (dominantType == typeof(DateTime))
                {
                    if (name != "Min" || name != "Max")
                    {
                        throw new ArgumentException("Can only use aggregate min or max methods on properties which are datetime");
                    }
                    List<DateTime> data = (List<DateTime>)itemsOfDominantTypeOnly.Cast<DateTime>().ToList();
                    return Aggregate<DateTime>(data, name);
                }
                else
                {
                    result = query.ToList();
                }
            }
            return result;
        }
        private object Pluck(object[] args)
        {
            object result;
            string predicate = args.First().ToString();
            var values = args.Skip(1).ToArray();
            var query = (IQueryable<object>)this.Select(predicate, values);
            object firstItem = query.FirstOrDefault();
            if (firstItem == null)
            {
                result = new List<object>();
            }
            else
            {
                var types = from i in query
                            group i by i.GetType() into g
                            where g.Key != typeof(DynamicNull)
                            orderby g.Count() descending
                            select new { g, Instances = g.Count() };
                var dominantType = types.First().g.Key;
                //remove items that are not the dominant type
                //e.g. string,string,string,string,false[DynamicNull],string
                var itemsOfDominantTypeOnly = query.ToList();
                itemsOfDominantTypeOnly.RemoveAll(item => !item.GetType().IsAssignableFrom(dominantType));
                if (dominantType == typeof(string))
                {
                    result = (List<string>)itemsOfDominantTypeOnly.Cast<string>().ToList();
                }
                else if (dominantType == typeof(int))
                {
                    result = (List<int>)itemsOfDominantTypeOnly.Cast<int>().ToList();
                }
                else if (dominantType == typeof(decimal))
                {
                    result = (List<decimal>)itemsOfDominantTypeOnly.Cast<decimal>().ToList();
                }
                else if (dominantType == typeof(bool))
                {
                    result = (List<bool>)itemsOfDominantTypeOnly.Cast<bool>().ToList();
                }
                else if (dominantType == typeof(DateTime))
                {
                    result = (List<DateTime>)itemsOfDominantTypeOnly.Cast<DateTime>().ToList();
                }
                else
                {
                    result = query.ToList();
                }
            }
            return result;
        }

		public T Single<T>(string predicate, params object[] values)
		{
			return predicate.IsNullOrWhiteSpace()
				? ((IQueryable<T>) Items.AsQueryable()).Single()
				: Where<T>(predicate, values).Single();
		}

	    public T SingleOrDefault<T>(string predicate, params object[] values)
		{
			return predicate.IsNullOrWhiteSpace()
				? ((IQueryable<T>)Items.AsQueryable()).SingleOrDefault()
				: Where<T>(predicate, values).SingleOrDefault();
		}
		public T First<T>(string predicate, params object[] values)
		{
			return predicate.IsNullOrWhiteSpace()
				? ((IQueryable<T>)Items.AsQueryable()).First()
				: Where<T>(predicate, values).First();
		}
		public T FirstOrDefault<T>(string predicate, params object[] values)
		{
			return predicate.IsNullOrWhiteSpace()
				? ((IQueryable<T>)Items.AsQueryable()).FirstOrDefault()
				: Where<T>(predicate, values).FirstOrDefault();
		}
		public T Last<T>(string predicate, params object[] values)
		{
			return predicate.IsNullOrWhiteSpace()
				? ((IQueryable<T>)Items.AsQueryable()).Last()
				: Where<T>(predicate, values).Last();
		}
		public T LastOrDefault<T>(string predicate, params object[] values)
		{
			return predicate.IsNullOrWhiteSpace()
				? ((IQueryable<T>)Items.AsQueryable()).LastOrDefault()
				: Where<T>(predicate, values).LastOrDefault();
		}
        public IQueryable<T> Where<T>(string predicate, params object[] values)
        {
            return ((IQueryable<T>)Items.AsQueryable()).Where(predicate, values);
        }
        public IQueryable<T> OrderBy<T>(string key)
        {
			return ((IQueryable<T>)Items.AsQueryable()).OrderBy(key, () => typeof(DynamicPublishedContentListOrdering));
        }
        public DynamicGrouping GroupBy(string key)
        {
            var group = new DynamicGrouping(this, key);
            return group;
        }
        public DynamicGrouping GroupedInto(int groupCount)
        {
            var groupSize = (int)Math.Ceiling(((decimal)Items.Count() / groupCount));
            return new DynamicGrouping(
               Items
               .Select((node, index) => new KeyValuePair<int, DynamicPublishedContent>(index, node))
               .GroupBy(kv => (object)(kv.Key / groupSize))
               .Select(item => new Grouping<object, DynamicPublishedContent>()
               {
                   Key = item.Key,
                   Elements = item.Select(inner => inner.Value)
               }));
        }
        public DynamicGrouping InGroupsOf(int groupSize)
        {
            return new DynamicGrouping(
                Items
                .Select((node, index) => new KeyValuePair<int, DynamicPublishedContent>(index, node))
                .GroupBy(kv => (object)(kv.Key / groupSize))
                .Select(item => new Grouping<object, DynamicPublishedContent>()
                {
                    Key = item.Key,
                    Elements = item.Select(inner => inner.Value)
                }));

        }

        public IQueryable Select(string predicate, params object[] values)
        {
	        return DynamicQueryable.Select(Items.AsQueryable(), predicate, values);
        }

        #endregion

        #region Dynamic

        public bool IsNull()
        {
            return false;
        }

        public bool HasValue()
        {
            return true;
        }

        #endregion

        #region Enumerate inner IPublishedContent items

        public IEnumerator<DynamicPublishedContent> GetEnumerator()
    	{
    		return Items.GetEnumerator();
    	}

    	IEnumerator IEnumerable.GetEnumerator()
    	{
    		return GetEnumerator();
        }

        #endregion
    }
}