text:
<?xml version="1.0" encoding="ISO-8859-1"?><document><title>FOP FAQ</title>
<title>1. Apache™ FOP: General questions</title>
<title>1.1. What is Apache™ FOP?</title>

        FOP is a print formatter for <link href="#xslfo">XSL formatting
        objects</link>.

        It can be used to render an XML file containing XSL formatting objects
        into a page layout. The main target is PDF but other rendering targets
        are supported, such as AWT, PCL, text and direct printing.

<title>1.2. What can I do with FOP?</title>

          FOP provides both an application and a library that converts an XSL FO
          document into paginated output.

          The FOP command line application can be directly used to transform XML
          into PDF, PostScript, PCL and other formats, there is also an AWT
          based viewer integrated.

          The library can be used in servlets and other Java applications.

<title>1.3. What does "FOP" stand for?</title>

          FOP is an acronym for Formatting
          Object Processor

<title>1.4. How does FOP interact with other Apache Projects?</title>

          <link href="http://xmlgraphics.apache.org/commons">XML Graphics Commons</link> is used with
          FOP to provide graphics functions that are common to a number of Apache projects.

          <link href="http://xmlgraphics.apache.org/batik">Batik</link> is used with
          FOP to <link href="http://xmlgraphics.apache.org/batik/svgrasterizer.html">transcode an SVG
          image</link> into a PDF document.

FOP also makes use of the following Apache projects:

<link href="http://excalibur.apache.org/framework/">Avalon Framework</link>

<link href="http://jakarta.apache.org/commons/io/">Jakarta Commons IO</link>

<link href="http://jakarta.apache.org/commons/logging/">Jakarta Commons Logging</link>

<link href="http://xalan.apache.org/">Xalan-J</link>

<link href="http://xml.apache.org/commons/components/external/">XML Commons Externals</link>

<title>1.5. What is XSL?</title>

          XSL is a W3C standard concerned with publishing XML documents. It
          consists of two parts: <link href="#XSLT">XSLT</link> and <link href="#xslfo">XSL-FO</link>. The acronym expands to
          eXtensible Stylesheet
          Language.

<title>1.6. What is XSL-FO?</title>

          XSLFO (aka XSL-FO) is an XML vocabulary, defined by W3C Recommendation
          <link href="http://www.w3.org/TR/xsl/">Extensible Stylesheet Language (XSL)
          Version 1.1</link>, that is used to specify a pagination and
          other styling for page layout output. The acronym “FO”
          stands for
          Formatting Objects. XSLFO can be
          used in conjunction with <link href="#XSLT">XSLT</link> to convert
          from any XML format into a paginated layout ready for printing or
          displaying.

          XSLFO defines a set of elements in XML that describes the way pages
          are set up. The contents of the pages are filled from flows. There can
          be static flows that appear on every page (for headers and footers)
          and the main flow which fills the body of the page.

          Synonyms: XSL FO, XSL (FO), XSL:FO, XSL-FO, Formatting Objects

<title>1.7. What is XSLT?</title>

          XSLT describes the transformation of arbitrary XML input into other
          XML (like XSLFO), HTML or plain text. The “T” comes from
          Transformation. For historical reasons, a
          transformation is often also called a “style sheet”.

          Synonyms: XSL transformation, XSL:T, XSL style sheet.

<title>1.8. When will feature X be implemented?</title>

The short answer is "Don't ask." For more details, see <link href="gethelp.html#limitations">Understand FOP's Limitations</link>.

<title>1.9. When is the next released planned?</title>

          Version 1.1 of FOP was released on 20 October 2012.
          Work on a new Version 1.2 of Apache FOP is underway at this time, with
          no fixed date set for its release.
          If you want to speed up the process, consider <link href="dev/index.html#involved">contributing</link> to FOP.

<title>1.10. Why did you redesign FOP between Versions 0.2X and 0.9X?</title>

The code redesign of FOP was necessary in order to be able to adress following issues:

Keeps and Breaks

XSL-FO Compliance in general

Process Files of Arbitrary Size

Minimize Memory Use

Table Layout

<title>1.11. How can I contribute?</title>

          There are numerous ways that you can help. They are outlined in the <link href="dev/index.html">Developer's Introduction</link> page.

<title>2. Problems running FOP</title>
<title>2.1. I get the error: [ERROR]: 'master-reference' for
      'fo:page-sequence' matches no 'simple-page-master' or
      'page-sequence-master'</title>

          FOP was changed to be in accordance with the latest standard (see
          <link href="resources.html#specs-xslfo">XSL standard</link>).The page
          master for a fo:page-sequence is now referenced by the
          master-reference attribute. Replace the master-name attributes of
          your fo:page-sequence elements by master-reference attributes. You
          have to do this also for fo:single-page-master-reference,
          fo:repeatable-page-master-reference and
          fo:conditional-page-master-reference elements in you page master
          definitions.

          Update your FO documents and style sheets.

<title>2.2. I get a NoClassDefFound exception.</title>

This is typically a problem with your classpath.

If you are running FOP from the command line:

            Use the command file fop.bat, fop.cmd or fop.js on MS Windows, or fop on Unix/Linux from the FOP
            distribution.

            If this doesn't help, check whether still all the jar files
            mentioned in the classpath in the fop.bat file are in their
            respective places.

          If you run FOP embedded in your servlet, web application or
          other Java application, check the classpath of the
          application. Check the also the information pertaining to <link href="1.0/servlets.html#servlet-engine">servlet engines</link>
          for further hints.

          If you downloaded the source distribution, or a snapshop
          from the repository, remember you have to build the FOP jars
          first.

<title>2.3. I get a NoSuchMethodException or a NoSuchFieldException
      exception.</title>

          This is usually caused by an older version of one of the FOP jars or
          old XML tools in the classpath.

          Incompatible versions of Batik may also cause this problem. Use the
          version of Batik that comes with FOP. It is not always possible to
          use a more recent version of Batik.

<title>2.4. I get an OutOfMemoryException.</title>

          See <link href="1.0/running.html#memory">FOP Memory</link>.

<title>2.5. I get a MalformedURLException.</title>
        <anchor id="MalformedURL"/>

          What you probably think of as "file names" are usually URLs, in
          particular the src attribute of fo:external-graphic.

          Because usage of URLs is growing, you should make yourself familiar
          with it. The relevant specification is <link href="http://www.rfc-editor.org/rfc/rfc2396.txt">RFC 2396</link>.

          In a nutshell, the correct syntax for an absolute file URL is
          file:///some/path/file.ext on Unix and
          file:///z:/some/path/file.ext on Windows systems. Note
          the triple slash, and also that only forward slashes are used, even on
          windows.

          A relative file URL starts with anything but a slash, and doesn't have
          the file: prefix, for example file.ext,
          path/file.ext or ../file.ext. The string
          file:path/file.ext is not a relative URL,
          in fact, it isn't a valid URL at all since the file
          scheme does not (officially) support relative paths. A relative URL
          is subject to a resolving process, which transforms it into an absolute
          URL.

<title>2.6. I get an "[ERROR]: null", or a NullPointerException.</title>

          This is a very likely a bug in FOP. If you encounter this error, please
          <link href="bugs.html#issues_new">Open a New Bug</link>.

<title>2.7. FOP returns the message "[ERROR] object|property - 'x' is not implemented yet." When will it be implemented?</title>

See FOP's Standards <link href="compliance.html">Compliance</link> page.

<title>2.8. FOP hangs. FOP does not exit.</title>

          The most likely reason is a known problem with the Java run time
          environment which is triggered by rendering SVGs. Sun's JDK 1.4 and
          later do not have this problem. See also <link href="#svghangs">FOP
          does not exit if a SVG is included</link>.

          Another possibility is that FOP went into a non terminating
          loop. Usually this is indicated by lots of log messages of the form
          "[INFO]: [NNNN]" which indicate a new page has been started or <link href="#boxoverflow">box overflows</link>. After some time, FOP will
          crash with an OutOfMemoryException.

          If you called the FOP command line application from some other
          program, for example from Java using Runtime.exec(), it may hang
          while trying to write log entries to the output pipe. You have to read
          the FOP output regularly to empty the pipe buffer. It is best to avoid
          exec'ing FOP, use the library interface instead.

          If you can reproduce this problem given a specific input and configuration,
          then please <link href="bugs.html#issues_new">Open a New Bug</link>.

<title>2.9. FOP runs forever, writing lots of ">" to the log.</title>

          There is something too large to fit into the intended place, usually a
          large image, a table whose rows are kept together or a block with a
          space-before or space-after larger than the page size. Catch the first
          page showing this phenomenon and check it. If it is not obvious which
          element causes the trouble, remove stuff until the problem goes
          away. Decrease the dimensions of the offending element or property, or
          increase the dimension of the enclosing element or container, or
          remove keep-with-* properties.

<title>2.10. FOP cannot find a file for fo:external-graphics.</title>

The src attribute of the fo:external-graphics element requires a URI, not a file name. See <link href="fo.html#external-resources">External Resources</link> for more information about specifying URIs.

<title>2.11. FOP does not find my fonts.</title>

          Did you get: “Failed to read font metrics file C:\foo\arial.xml
          : File "C:\foo\arial.xml" not found”? The value for the
          metrics-file attribute in the user config file is actually an URL, not
          a file name. Use "file:///C:/foo/arial.xml" instead.

          If you used a relative URL, make sure your application has the working
          directory you expect. Currently FOP does not use the baseDir for
          resolving relative URLs pointing to font metric files.

          Try also setting the <link href="1.0/configuration.html#general-elements">font-base
          configuration</link>.

<title>2.12. I get a SAXException: Mismatch: page-sequence vs. root
        (or similar).</title>

          The full exception usually looks similar to this:

        <source xml:space="preserve">Mismatch: page-sequence (http://www.w3.org/1999/XSL/Format) vs. root
        (http://www.w3.org/1999/XSL/Format)</source>

          This exception is usually a follow-up error after another exception. Sometimes
          the original exception gets swallowed by Xalan's default ErrorListener
          (should be fixed in the latest Xalan release).

          The work-around is to set an explicit ErrorListener on the
          Transformer. The ErrorListener can be as simple as this:

        <source xml:space="preserve">
import javax.xml.transform.ErrorListener;
import javax.xml.transform.TransformerException;

public class DefaultErrorListener implements ErrorListener {

    public void warning(TransformerException exc) {
        System.err.println(exc.toString());
    }

    public void error(TransformerException exc)
            throws TransformerException {
        throw exc;
    }

    public void fatalError(TransformerException exc)
            throws TransformerException {
        throw exc;
    }

}</source>

<title>2.13. The following message appears after recently upgrading FOP:
        "I/O exception while reading font cache (org.apache.fop.fonts.EmbedFontInfo;
        local class incompatible: stream classdesc serialVersionUID =
        -9075848379822693399, local class serialVersionUID = 8755432068669997367).
        Discarding font cache file."</title>

          This message is a warning that FOP failed to read from the Font cache.
          Which means any Font auto detection or Font directories will be re-scanned.
          So this failure doesn't break anything.

          To avoid the warning you can simply delete the
          old Font Cache file, which lives in ${base}\conf\font.cache (see <link href="1.0/configuration.html#general-elements">font-base
          configuration</link>).

<title>3. Problems with FOP output</title>
<title>3.1. Leaders don't work in current FOP. Instead of
      filling the line, only three dots or a short ruler is
      output.</title>

          Leaders still work, in fact they work better than ever
          before. You'll just have to add text-align="justify" and/or
          text-align-last="justify" to the block with the leader. Be
          sure you haven't accidentally overridden the
          leader-length.maximum="100%" default value.

          Earlier versions of FOP used to expand a leader to fill the
          rest of the line unconditionally, anything following it,
          like page numbers in a TOC, was actually shifted beyond the
          right margin.

          The new implementation uses leader-length.optimum to
          determine where to break the line, and expands the leader
          only further if the line should be filled, as indicated by
          the text-align and text-align-last properties.

          Actually due to the fuzzyness of the specification both the
          old and the new method are conformant (although adding text
          after the expanded leader in the old variant never was).

          If you want to have a longer ruler or space in a
          non-justified line, you have to increase the
          leader-length.optimum property.

<title>3.2. Why does FOP insert a blank page between my page sequences?</title>

          This is because spec conformance has been improved.

          The <link href="http://www.w3.org/TR/xsl11/#force-page-count">force-page-count
          property</link> controls how a FO processor pads page sequences in
          order to get certain page counts or last page numbers. The default is
          "auto". With this setting, if the next page sequence
          begins with an odd page number because you set the
          initial-page-number, and the current page sequence also ends with an
          odd page number, the processor inserts a blank page to keep odd and
          even page numbers alternating (similar for the case the current page
          sequence ends with an even page number and the next page sequence
          starts with an even page number).

          If you don't want to have this blank page, use
          force-page-count="no-force".

<title>3.3. Why is my graphic not rendered?</title>

Most commonly, the external file is not being found by FOP.
Check the following:

Empty or wrong baseDir setting.

Spelling errors in the file name (including using the wrong case).

Security Problems (i.e. the image could not be accessed
          because FOP is not allowed to read the file). This is
          especially a problem if the external file is retrieved over
          HTTP. Possible issues include security settings on the
          server, server configuration, and missing cookies or other
          authorization information. Any easy way to check this is to
          cut and paste the source URL from the fo:external-graphic
          into the Location field of a browser on the machine
          where the FOP process will be running.

Other possibilities:

The image format is not supported or not supported completely.
          See <link href="1.0/graphics.html">FOP Graphics Formats</link> for a
          list of supported formats and related issues.

The graphic may be too large to fit into the intended space.

There may be something (static content) that is obscuring the
          graphic. (This is very rare).

<title>3.4. My graphical images do not work properly.</title>

See <link href="1.0/graphics.html">FOP Graphics Formats</link> for a
        list of supported graphics formats and related issues.

<title>3.5. Why is my graphic rendered at a different resolution than it was created?</title>

See <link href="1.0/graphics.html#resolution">Graphics Resolution</link>.

<title>3.6. Keep-with-next, keep-with-previous, keep-together
      don't work.</title>

		  Current FOP releases have extensive support for
          these properties. The current release, FOP 1.0, still supports the
          values "always" and "never" only, no numerical values. There may be
          a few places where keep-* still don't work, this should be very rare.

          The concept is called “blind table”. The table is used for
          pure layout reasons and is not obvious in the output.

          An example of an image and the image caption to be kept together:

        <source xml:space="preserve"><fo:table table-layout="fixed" width="100%">
  <fo:table-column column-width="proportional-column-width(1)"/>
  <fo:table-body>
    <fo:table-row keep-with-next="always">
      <fo:table-cell>
        <fo:block>
          <fo:external-graphic src="foo.jpg"/>
        </fo:block>
      </fo:table-cell>
    </fo:table-row>
    <fo:table-row>
      <fo:table-cell>
        <fo:block>Image Caption</fo:block>
      </fo:table-cell>
    </fo:table-row>
  </fo:table-body>
</fo:table></source>

          Consider upgrading to the latest version which supports keeps.

<title>3.7. My tables are missing, or missing their content.</title>

          Check for fo:table-body around the rows. Usually FOP will catch this problem.

          Also, the fo:table-with-caption element is not implemented, tables
          within such an element are dropped too. FOP generates an error
          message for this problem. Older DocBook style sheets generate
          fo:table-with-caption elements, so watch out.

<title>3.8. Text overflowing table cells and the like is not clipped. Long
        text flows into adjacent cells/block, obscuring stuff there.</title>

          Since the overflow property doesn't apply to table-cell, you
          can wrap the cell content in a block-container and specify
          overflow="hidden" there. Alternatively,
          if you have long words overflowing table cells, try to
          get them hyphenated. Artificial names like product identifications or
          long numbers usually aren't hyphenated. You can try special processing
          at XSLT level, like

            clip long text,

            explicit wrapping+clipping,

            insert zero width spaces (&#x200B;) to allow FOP to
            wrap.

          Check the <link href="http://dpawson.co.uk/xsl">XSL FAQ</link> and the
          <link href="http://www.mulberrytech.com/xsl/xsl-list/">XSL list
          archive</link> for how to perform these tasks.

<title>3.9. The contents of table cells don’t wrap</title>

You probably have keep-together="always" set on the table cell. See <link href="#keep-together">next question</link>.

<title>3.10. FOP behaves differently from earlier versions when keep-together="always"
        is set on table cells</title>

Support for inline-level keeps has been added in FOP 0.95, and setting
          keep-together="always" also implicitly sets
          keep-together.within-line="always", which forbids FOP
          to break the text into multiple lines. Set
          keep-together.within-column="always" on table-cell instead. It’s a good idea
          not to use the shorthand keep-together="always" at all!

<title>3.11. FOP tells me: "The contents of row 1 are taller than they should be".
        What does that mean?</title>

          This is usually caused by setting a "height" on a table-row or table-cell and when
          the content is higher than the specified height. By setting "height" (a so-called
          corresponding property) you
          <link href="http://www.w3.org/TR/xsl11/#d0e4413">implicitely set</link>
          block-progression-dimension.minimum, block-progression-dimension.optimum and
          block-progression-dimension.maximum to the same value. You'll get some information
          about that in the warning message. Look for something like:
          "MinOptMax[min=opt=max=14000]".

          Assuming you set the height on the table-row to 14pt and your content is 75pt high,
          a constraint (maximum=14pt) is violated. Normally, you just want to make sure
          with the "height" property that the row has a minimum height. If that is so, the
          right solution is to specify block-progression-dimension.minimum="14pt" instead of
          height="14pt".

<title>3.12. Page numbers are not properly right aligned.</title>

          This happens for fo:page-number-citation elements if the
          citation occurs before FOP formatted the requested page,
          usually in TOC or index pages. It is caused by the problem
          that FOP has to guess how much space the yet unknown page
          number will occupy, and usually the guesses are somewhat
          off.

          The most recent FOP releases should have this problem
          fixed. Check whether you can upgrade.

<title>3.13. Hyphenation does not work.</title>

Make sure you have set the language and optionally the country attributes for an appropriate XSL-FO element (fo:page-sequence, fo:block or fo:character):

        <source xml:space="preserve"><fo:page-sequence language="fi"></source>

See <link href="1.0/hyphenation.html#support">Hyphenation Support</link> for details and instructions on using hyphenation with FOP.

Explicitly enable hyphenation for an appropriate XSL-FO element (fo:block, fo:character):

        <source xml:space="preserve"><fo:block hyphenate="true"></source>

<title>3.14. When I use margins, my content in a nested table or block-containers gets indented twice. Is this a bug?</title>

          No, although you might easily think so. The problem has to do
          with property inheritance of the start-indent and end-indent
          properties to which the margin properties are mapped. Apache
          FOP strictly adheres to the XSL-FO specification here which many
          other commercial FO implementations don't do to better meet end-user
          expectations. You can make FOP behave like these if you set
          setBreakIndentInheritanceOnReferenceAreaBoundary(true)
          on the FOUserAgent. The better way is to reset start-indent
          and end-indent to "0pt" on table-body or block-container.
          For further details, please consult the
          <link href="http://wiki.apache.org/xmlgraphics-fop/IndentInheritance">Wiki page on Indent Inheritance</link>.

<title>3.15. Why is the output of Java2D/AWT-based renderers different than, for example, PDF or PS?</title>

          If you render the same document once to a PNG or TIFF and once into a PDF, the output
          may not be the same, i.e. line breaks are different or lines may have different heights.
          The reason for this: The Java2D-based renderers use the font subsystem of Java2D/AWT. The
          PDF and PS renderers use FOP's own font subsystem which provides much better font metrics
          than Java2D. These can lead to different layout decisions when the same document is
          rendered with different renderers. An alternative approach to fix this problem might be
          available but it hasn't been tested, yet. See also the
          <link href="1.0/output.html#general-fonts">notes on fonts in the various output formats</link>.

<title>4. Embedding FOP. Using FOP in a servlet.</title>
<title>4.1. How do I use FOP in a servlet?</title>

          See <link href="1.0/servlets.html">Using FOP in a Servlet</link>.

<title>4.2. How do I use FOP in a servlet with an XSLT
      transformation?</title>

          See <link href="1.0/servlets.html#xslt">Using FOP in a Servlet with XSLT Transformation</link>.

<title>4.3. How do I pass parameters to the XSLT transformation?</title>

          See <link href="1.0/servlets.html#xslt">Using FOP in a Servlet with XSLT Transformation</link>.

<title>4.4. How do I use my own fonts when running FOP from a servlet?</title>

          Declare the fonts in the userconfig.xml file as usual.
          See <link href="#usercfg">loading the user configuration file</link>
          for further details.

<title>4.5. How do I set the baseDir property in a servlet environment?</title>

          See <link href="1.0/embedding.html#config-internal">Setting the Configuration Programmatically</link>.

<title>4.6. How do I use a user configuration file from a servlet?</title>

          See <link href="1.0/embedding.html#config-external">Using a Configuration File in an Embedded App</link>.

<title>4.7. I keep getting NoClassDefFound and other exceptions. How do I
        get FOP working for various servlet engines?</title>

          See <link href="1.0/servlets.html#servlet-engine">Servlet Engines</link>.

<title>4.8. Can FOP be used in multithreaded environments?</title>

          See <link href="1.0/embedding.html#multithreading">Multithreading FOP</link>.

<title>5. SVG specific questions</title>
<title>5.1. The rendering of SVG text in my PDF is of poor quality.
Can I control this?</title>

See <link href="1.0/graphics.html#svg-pdf-text">Placing SVG Text into PDF</link>.

<title>5.2. How do I use FOP with SVG on headless servers?</title>

See <link href="1.0/graphics.html#batik">FOP: Graphics (Batik)</link>.

<title>5.3. FOP does not exit if a SVG is included.</title>

          Applies to older FOP versions and JDK 1.3 and older. That's because
          there is an AWT thread hanging around. The solution is to put a
          System.exit(0) somewhere.

<title>5.4. I have problems with SVG referring to gradients etc. using
        "uri(#stuff)". I get a MalformedURLException.</title>

          This is really a "resolving relative URI" problem with some
          twists. The problem is that the #stuff URL fragment
          identifier is resolved within the current SVG document. So the
          reference must be valid within the XML subset and it cannot
          reference other SVG documents in the same XML file. Some options
          to try:

            Put the SVG into a separate file and use it with
            fo:external-graphics.

            Use a separate SVG file which contains only the gradient (and
            perhaps other SVG stuff you want to reference) and point an absolute
            URL to it:
            fill="url(file:///c:/refstuff/grad.svg#PurpleToWhite)".

            Same as above but use a relative URL:
            fill="url(grad.svg#PurpleToWhite)". This may be easier
            to deploy.

            Make sure that the reference is valid in the current SVG document.

          In any case, the referenced stuff has to be pointed to by an URL. It
          doesn't necessarily have to be a file URL, HTTP should also
          work. Also, expect a performance hit in all cases, because another XML
          file has to be retrieved and parsed.

          Ultimately, both FOP and especially Batik should be fixed to make
          your code work as expected, but this will not only take some time
          but also some effort by a standard committee in order to make the
          semantics of this kind of references in embedded SVG clearer.

See also <link href="#MalformedURL">MalformedURLException</link>

<title>5.5. Why is my SVG rendered at a size different from that specified in my fo:external-graphic element?</title>

See <link href="1.0/graphics.html#svg-scaling">SVG Scaling</link>.

<title>5.6. FOP fails with something like "The attribute "width" of the element <rect> is required". What's wrong?</title>

          This phenomenon is not a
          bug in FOP, but rather in the dependent packages: Apache Batik, Apache Xalan-J and SAXON. The bug in Apache Batik will be
          fixed in the next release. In the latest release of Apache Xalan-J, the bug is already fixed. It only occurs in the Xalan
          version bundled with Sun's JVM, because Sun uses a rather old version.

          Bug description: In a namespace-enabled Level 3 DOM, an attribute in the default namespace must be set with
          "null" as the value for the namespace URI. SAX, on the other side, uses an empty string ("") to designate
          the default namespace. Many packages appear to not properly handle this difference in which case they still use the empty
          string as the namespace URI parameter for org.w3c.dom.Element.setAttributeNS().

          Work-around: Use the latest version of Apache Xalan-J. Note that starting with JDK 1.4 it's not enough to replace Xalan-J
          on the normal application classpath and you need to override the Xalan-J version bundled with the Sun JVM using the
          <link href="http://java.sun.com/j2se/1.4.2/docs/guide/standards/">Endorsed Standards Override Mechanism</link>, i.e.
          you must place Xalan-J in the "lib/endorsed" directory of your JRE.

<title>6. PDF specific (includes Acrobat peculiarities)</title>
<title>6.1. How do I embed fonts in PDF?</title>

          See the <link href="1.0/fonts.html">Fonts</link> page for information
          about embedding fonts.

<title>6.2. Some characters are not displayed, or displayed incorrectly, or
      displayed as “#”.</title>

          This usually means the selected font doesn't have a glyph
          for the character.

          The standard text fonts supplied with Acrobat Reader have
          mostly glyphs for characters from the ISO Latin 1 character
          set. For a variety of reasons, even those are not completely
          guaranteed to work, for example you can't use the fi
          ligature from the standard serif font. Check the <link href="1.0/output.html#pdf-fonts">overview</link> for the default
          PDF fonts.

          If you use your own fonts, the font must have a glyph for
          the desired character. Furthermore the font must be
          available on the machine where the PDF is viewed or it must
          have been embedded in the PDF file. See <link href="1.0/fonts.html">embedding fonts</link>.

          For most symbols, it is better to select the symbol font
          explicitely, for example in order to get the symbol for the
          mathematical empty set, write:

        <source xml:space="preserve"><fo:inline font-family="Symbol">&#x2205;</fo:inline></source>

          The "#" shows up if the selected font does not define a glyph for the
          required character, for example if you try:

        <source xml:space="preserve"><fo:inline font-family="Helvetica">&#x2205;</fo:inline></source>

<title>6.3. What tools are available for post-processing my PDF document?</title>

See <link href="1.0/output.html#pdf-postprocess">PDF Post-processing</link>.

<title>6.4. How do I add security features (encryption, disable printing)
      to my PDF document?</title>

          See <link href="1.0/pdfencryption.html">PDF Encryption</link>.
          See also <link href="1.0/output.html#pdf-postprocess">PDF Post-processing</link>.

<title>6.5. How do I add document properties (title, author, etc.) to my
      PDF document?</title>

See <link href="1.0/metadata.html">Metadata</link>.

<title>6.6. How do I add watermarks to my PDF document?</title>

See <link href="1.0/output.html#pdf-watermark">PDF Watermarks</link>.

<title>6.7. The PDF is printed contorted!</title>

          Check the paper size in Acrobat settings and the "fit to page" print
          setting. Contorted printing is often caused by a mismatched paper
          format, for example if the setting is "US Letter" but the PDF was
          made for A4. Sometimes also the printer driver interferes, check its
          settings too.

<title>6.8. How do I control the Acrobat bookmark display?</title>

          FOP supports the starting-state property of the XSL 1.1
          <link href="http://www.w3.org/TR/xsl11/#fo_bookmark">fo:bookmark</link>
          element which can be used for this. The color, font-style and
          font-weight properties on
          <link href="http://www.w3.org/TR/xsl11/#fo_bookmark-title">fo:bookmark-title</link>
          are not yet supported, though.

<title>6.9. How can I get rid of strange single-pixel lines inside table borders or between table cells in Adobe Acrobat?</title>

          Since Apache FOP supports the collapsed border model, every border segment consists
          of two separate shapes. This is due to the fact that each side of the border
          segment can have a different color. Now, Adobe Acrobat may display thin (1 pixel wide)
          lines inside the border segment or sometimes even between to adjacent
          colored rectangles making up the background of a block or table cell.
          This effect is due to the way Adobe Acrobat does anti-aliasing. Adobe's algorithm
          seems to cause these artifacts. Other PDF viewers don't have that problem. Or at least
          we haven't had any reports in that direction.

          First of all, these artifacts do not appear in print since no anti-aliasing is done
          by Adobe Acrobat in this case (except maybe if you tell Acrobat to print the page
          as a bitmap in which case Adobe fully composes the page itself). So, if the artifacts appear
          on screen, it doesn't mean they have to appear in print, too.

          To get rid of the artifacts, you can call up the "Preferences" dialog of
          Adobe Acrobat and select the tab "Page display". Enabling "Enhance thin lines"
          may help in some situations. Otherwise, you can disable "Smooth line art".
          You may have to disable "Use 2D graphics acceleration", too, so you can disable
          "Smooth line art" in the first place.

          Here an example of how the effect can look like (left: anti-aliasing on, right: anti-aliasing off):

          Unfortunately, it is not possible to control the above settings from within the PDF file.
          The user has to change these settings himself. Improving FOP to avoid this kind of problem
          would be possible although rather hard to achieve because we'd need to add a considerable
          amount of code to combine the various line segments. Something like that has been tried already
          years ago showing that this is a tricky task. Also, the improvement may not justify the amount
          of effort required.

<title>7. IEx specific stuff</title>
<title>7.1. The FOP servlet is called multiple times!</title>

          This is a problem of Internet Explorer requesting the content several
          times. Please see the <link href="1.0/servlets.html#ie">notes on Internet Explorer</link>
          for more information.

<title>7.2. How do I print PDF directly from the browser?</title>

          It depends whether you mean "printing to a printer under control of
          the server" or "printing on the client's printer".

          For the first problem, look at the print servlet in the FOP
          examples. You'll have to gather any printer settings in a HTML form
          and send it to the server.

          For the second task, you can use some client side script to start
          Acrobat Reader in print mode, or use a Java applet based on the FOP
          print servlet. This depends heavily on the client installation and
          should not be relied on except in tightly controlled environments.

          See also <link href="http://marc.theaimsgroup.com/?l=fop-dev&m=101065988325115&w=2">http://marc.theaimsgroup.com/?l=fop-dev&m=101065988325115&w=2</link>

<title>8. General questions regarding XSLT, XSLFO, and basic XML</title>
<title>8.1. (FO) How do I vertically center an image or a table (or
      whatever)?</title>

          See <link href="fo.html#fo-center-vertical">XSL-FO Vertical Centering</link>.

<title>8.2. (FO) How do I center a table horizontally?</title>

          See <link href="fo.html#fo-center-table-horizon">XSL-FO Horizontal Centering (Tables)</link>.

<title>8.3. (FO) How to get page numbers printed on the "outer side" of the
        page (for books, for example)?</title>

          See <link href="fo.html#fo-oddeven">Recto/Verso Static Content Differences</link>.

<title>8.4. (FO) How do I use different static content for odd and even
      pages?</title>

          See <link href="fo.html#fo-oddeven">Recto/Verso Static Content Differences</link>.

<title>8.5. (FO) How do I get a special header on the first page?</title>

          See <link href="fo.html#fo-first-page">Making the First Page Special</link>.

<title>8.6. (FO) How do I omit my headers on a blank page? How do I write
      "This page is left blank" on an intentionally blank page?</title>

          See <link href="fo.html#fo-blank-pages">Blank Pages</link>.

<title>8.7. (FO) How do I print an Euro sign, a checkbox or other some other
      special symbols?</title>

          See <link href="fo.html#xml-special-chars">Special Characters</link>.

<title>8.8. (FO) How do I keep linebreaks and hard spaces? How do I get
        preformatted text displayed as expected?</title>

          See <link href="fo.html#fo-preformat">Preformatting Content</link>.

<title>8.9. (FO) How do I print the total number of pages, for example "page 1
      of 12"</title>

          See <link href="fo.html#fo-total-pages">Total Document Pages</link>.

<title>8.10. (FO) The header overlaps body content. The body extends into
      the footer.</title>

          See <link href="fo.html#fo-region-align">Aligning Regions</link>.

<title>8.11. (FO) How do I get lines in the document, as separators, side
      bars or folding marks?</title>

          See <link href="fo.html#fo-lines">Drawing Lines</link>.

<title>8.12. (FO) How do I validate my FO document?</title>

          See <link href="fo.html#fo-validate">Validating XSL-FO</link>.

<title>8.13. (XML) How do I get a non-breaking space in FO? There are complaints about &nbsp;.</title>

          See <link href="fo.html#xml-special-chars">XML Special Characters</link>.

<title>8.14. (XML) How do I enter special characters in XML? There are complaints about undefined entities, such as &uuml;, which work in HTML. </title>

          See <link href="fo.html#xml-special-chars">XML Special Characters</link>.

<title>8.15. (XML) There are complaints about illegal characters and entities
      in the input.</title>

          See <link href="fo.html#xml-entity-chars">Using HTML Character Names</link>.

<title>8.16. (XML) There are complaints about illegal bytes or characters in
      the input. There are odd characters in the result.</title>

          See <link href="fo.html#xml-encoding">XML Encoding Issues</link>.

<title>8.17. (XSLT) How can I use the current date and time in my document?</title>

See <link href="fo.html#xslt-date">Current Date and Time</link>.

<title>8.18. Can I use FOP to convert XHTML or HTML files to PDF?</title>

          You will get better results if you transform your source
          XML directly into XSLFO. It is tempting to use the
          XML->XHTML->XSLFO approach, because this apparently means
          there's only one transformation to maintain, but XHTML
          and publishing grade PDF are dissimilar enough that an
          "generic" XHTML->XSLFO(PDF) usually wont cut it, because
          the XHTML already lacks information from the original XML.
          It may be worthwhile to go from the source XML to an
          intermediate custom XML which on one hand is close enough
          to representation to allow simple transformation to either
          XHTML or XSLFO for most of the structure, but on the other
          hand retains enough semantic from the original XML that
          elements which must be handled differently in the two
          representations can be handled differently. Setting this
          up requires experience and most likely extensive prototyping.

<title>8.19. I know it may be a bad idea to use FOP to convert XHTML or HTML files to PDF, but I want to do it anyway. Are there any tools available to help me?</title>

          The <link href="resources.html">FOP Resources page</link> has links
          to a tool called <link href="http://html2fo.sourceforge.net/">html2fo</link>
          which can be used to make such a transformation. In addition, there
          are tools on the Antenna House <link href="http://www.antennahouse.com/XSLsample/XSLsample.htm">XSL-FO Tutorial and Sample</link>
          page.

<title>9. Development-related Questions.</title>
<title>9.1. Where can I learn how the FOP docs and web site are built?</title>

          See FOP <link href="dev/doc.html">Doc Management</link>.

<title>10. General suggestions. How to solve problems.</title>
<title>10.1. I think I have found a bug in FOP. What should I do?</title>

          See <link href="bugs.html">the Bugs page</link> for information about
          bugs already reported and how to report new ones.

<title>10.2. I have questions that are not addressed in this FAQ. Where
      should I post them?</title>

If your question is a development-related question, please see the <link href="dev/faq.html">Developer FAQs</link>.

            If you have a runtime exception or other runtime problem:

                Double check the <link href="#part-running">Runtime FAQs</link>.

                ClassNotFoundException, NoSuchMethodException and
                NoSuchFieldException problems are almost always a problem with
                the local environment. Try to get local help first.

                Check <link href="bugs.html#issues_existing">Reported Issues</link>
                to see if this is a known problem.

If none of the above apply, post a question to the fop-dev
                mailing list.

            In the case where something works properly with another formatter,
            (e.g., AntennaHouse, PassiveTex, etc.) but doesn't work with FOP, please
            check the Release Notes, the
            <link href="compliance.html">FOP Standards Compliance</link> document,
            and the remaining FAQ in this document. If not found there, look at the
            list of <link href="bugs.html#issues_existing">Bugs Already Reported</link>.
            If not found there, please post a question on the fop-user mailing list
            or <link href="bugs.html#issues_new">Open a New Bug</link>.

            Question about how to use FOP, how to perform certain tasks with FOP
            or how to integrate FOP into another application should be posted to
            fop-user.

            XSLT specific stuff sould go to the <link href="http://www.mulberrytech.com/xsl/xsl-list/">XSL
            list</link>. This includes problems with the language and XSLT
            HOW-TOs.

            Problems specific to a certain XSLT processor, like Xalan, Saxon or
            MSXML, should be handled by processor specific lists. This includes
            problems with deployment, processor specific extensions, suspected
            bugs and processor specific APIs. Note that JDK 1.4 and later come with an
            XML parser and an XSLT processor which may be the source of the problem.

            Problems with servlet containers should be asked on the vendor
            specific lists for these software packages.

            More general questions regarding Java, including deployment, Java
            APIs, classpath issues and property definitions should be redirected
            to an appropriate Java specific list.

</document>


text:
<?php

/**
 * @file
 * Contains \Drupal\Core\StringTranslation\TranslationManager.
 */

namespace Drupal\Core\StringTranslation;

use Drupal\Core\StringTranslation\Translator\TranslatorInterface;
use Drupal\Component\Utility\String;

/**
 * Defines a chained translation implementation combining multiple translators.
 */
class TranslationManager implements TranslationInterface, TranslatorInterface {

  /**
   * An array of active translators keyed by priority.
   *
   * @var array
   *   Array of \Drupal\Core\Translation\Translator\TranslatorInterface objects
   */
  protected $translators = array();

  /**
   * Holds the array of translators sorted by priority.
   *
   * If this is NULL a rebuild will be triggered.
   *
   * @var array
   *   An array of path processor objects.
   *
   * @see \Drupal\Core\StringTranslation\TranslationManager::addTranslator()
   * @see \Drupal\Core\StringTranslation\TranslationManager::sortTranslators()
   */
  protected $sortedTranslators = NULL;

  /**
   * The default langcode used in translations.
   *
   * @var string
   *   A language code.
   */
  protected $defaultLangcode;

  /**
   * Constructs a TranslationManager object.
   */
  public function __construct() {
    // @todo Inject language_manager or config system after language_default
    //   variable is converted to CMI.
    $this->defaultLangcode = language_default()->id;
  }

  /**
   * Appends a translation system to the translation chain.
   *
   * @param \Drupal\Core\Translation\Translator\TranslatorInterface $translator
   *   The translation interface to be appended to the translation chain.
   * @param int $priority
   *   The priority of the logger being added.
   *
   * @return \Drupal\Core\Translation\TranslationManager
   *   The called object.
   */
  public function addTranslator(TranslatorInterface $translator, $priority = 0) {
    $this->translators[$priority][] = $translator;
    // Reset sorted translators property to trigger rebuild.
    $this->sortedTranslators = NULL;
    return $this;
  }

  /**
   * Sorts translators according to priority.
   *
   * @return array
   *   A sorted array of translators objects.
   */
  protected function sortTranslators() {
    $sorted = array();
    krsort($this->translators);

    foreach ($this->translators as $translators) {
      $sorted = array_merge($sorted, $translators);
    }
    return $sorted;
  }

  /**
   * {@inheritdoc}
   */
  public function getStringTranslation($langcode, $string, $context) {
    if ($this->sortedTranslators === NULL) {
      $this->sortedTranslators = $this->sortTranslators();
    }
    foreach ($this->sortedTranslators as $translator) {
      $translation = $translator->getStringTranslation($langcode, $string, $context);
      if ($translation !== FALSE) {
        return $translation;
      }
    }
    // No translator got a translation.
    return FALSE;
  }

  /**
   * {@inheritdoc}
   */
  public function translate($string, array $args = array(), array $options = array()) {
    // Merge in defaults.
    if (empty($options['langcode'])) {
      $options['langcode'] = $this->defaultLangcode;
    }
    if (empty($options['context'])) {
      $options['context'] = '';
    }
    $translation = $this->getStringTranslation($options['langcode'], $string, $options['context']);
    $string = $translation === FALSE ? $string : $translation;

    if (empty($args)) {
      return $string;
    }
    else {
      return String::format($string, $args);
    }
  }

  /**
   * Sets the default langcode.
   *
   * @param string $langcode
   *   A language code.
   */
  public function setDefaultLangcode($langcode) {
    $this->defaultLangcode = $langcode;
  }

  /**
   * {@inheritdoc}
   */
  public function reset() {
    if ($this->sortedTranslators === NULL) {
      $this->sortedTranslators = $this->sortTranslators();
    }
    foreach ($this->sortedTranslators as $translator) {
      $translator->reset();
    }
  }

}

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0"?>
<ruleset name="PSR-MOD">
    <description>Based on PSR-2</description>

    <rule ref="PSR2">
        <!-- exclude rules -->
        <exclude name="PSR1.Classes.ClassDeclaration"/>
        <exclude name="PSR1.Files.SideEffects"/>
        <exclude name="Squiz.WhiteSpace.SuperfluousWhitespace"/>
        <!-- exclude files -->
        <exclude-pattern>*.md</exclude-pattern>
    </rule>

    <!-- Use single quote -->
    <rule ref="Squiz.Strings.DoubleQuoteUsage" />
    <rule ref="Squiz.Strings.DoubleQuoteUsage.ContainsVar">
        <severity>0</severity>
    </rule>

    <!-- Line Length -->
    <rule ref="Generic.Files.LineLength">
        <properties>
            <property name="lineLimit" value="120"/>
            <property name="absoluteLineLimit" value="120"/>
        </properties>
    </rule>

</ruleset>


text:
package androidx.media3.effect;

/**
 * Interface for a {@link GlTextureProcessor} that samples from an external texture.
 *
 * <p>Use {@link #setTextureTransformMatrix(float[])} to provide the texture's transformation
 * matrix.
 */
/* package */ interface ExternalTextureProcessor extends GlTextureProcessor {

  /**
   * Sets the texture transform matrix for converting an external surface texture's coordinates to
   * sampling locations.
   *
   * @param textureTransformMatrix The external surface texture's {@linkplain
   *     android.graphics.SurfaceTexture#getTransformMatrix(float[]) transform matrix}.
   */
  void setTextureTransformMatrix(float[] textureTransformMatrix);
}


text:
external help file: Microsoft.Azure.Commands.Aks.dll-Help.xml
Module Name: AzureRM.Aks
online version: https://docs.microsoft.com/en-us/powershell/module/azurerm.aks/get-azurermaks
schema: 2.0.0
---

# Get-AzureRmAks

## SYNOPSIS
List Kubernetes managed clusters.

## SYNTAX

### ResourceGroupParameterSet (Default)
```
Get-AzureRmAks [[-ResourceGroupName] <String>] [-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]
```

### IdParameterSet
```
Get-AzureRmAks [-Id] <String> [-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]
```

### NameParameterSet
```
Get-AzureRmAks [-ResourceGroupName] <String> [-Name] <String> [-DefaultProfile <IAzureContextContainer>]
 [<CommonParameters>]
```

## DESCRIPTION
List Kubernetes managed clusters.

## EXAMPLES

### List all Kubernetes clusters
```
PS C:\> Get-AzureRmAks
```

## PARAMETERS

### -DefaultProfile
The credentials, account, tenant, and subscription used for communication with Azure.

```yaml
Type: Microsoft.Azure.Commands.Common.Authentication.Abstractions.IAzureContextContainer
Parameter Sets: (All)
Aliases: AzureRmContext, AzureCredential

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Id
Id of a managed Kubernetes cluster

```yaml
Type: System.String
Parameter Sets: IdParameterSet
Aliases: ResourceId

Required: True
Position: 0
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```

### -Name
Name of your managed Kubernetes cluster

```yaml
Type: System.String
Parameter Sets: NameParameterSet
Aliases:

Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -ResourceGroupName
Resource group name

```yaml
Type: System.String
Parameter Sets: ResourceGroupParameterSet
Aliases:

Required: False
Position: 0
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

```yaml
Type: System.String
Parameter Sets: NameParameterSet
Aliases:

Required: True
Position: 0
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).

## INPUTS

### System.String

## OUTPUTS

### Microsoft.Azure.Commands.Aks.Models.PSKubernetesCluster

## NOTES

## RELATED LINKS


text:
using Gadfly, DataFrames

@doc """
  PLOTDATAPOINTS plots data points in X, coloring them so that those with the same
  index assignments in idx have the same color
    PLOTDATAPOINTS(X, idx, K) plots data points in X, coloring them so that those
    with the same index assignments in idx have the same color
""" ->
function plotDataPoints(X, idx, K)

  colors = Scale.color_discrete().f(K)
  # Plot the data
  df = convert(DataFrame, [X idx])

  ls = []

  for sg in groupby(df, :x3)
    l = layer(sg, x="x1", y="x2", Theme(default_color=colors[convert(Int32, sg[:x3][1])]), Geom.point)
    push!(ls, l)
  end
  return ls
end


text:
const DrawCard = require('../../drawcard.js');
const { Locations, Decks, Phases, Durations } = require('../../Constants');

class ArtisanAcademy extends DrawCard {
    setupCardAbilities(ability) {
        this.action({
            title: 'Make top card of conflict deck playable',
            phase: Phases.Conflict,
            condition: context => context.player.conflictDeck.size() > 0,
            effect: 'reveal the top card of their conflict deck',
            gameAction: ability.actions.playerLastingEffect(context => {
                let topCard = context.player.conflictDeck.first();
                return {
                    duration: Durations.Custom,
                    until: {
                        onCardMoved: event => event.card === topCard && event.originalLocation === Locations.ConflictDeck,
                        onPhaseEnded: event => event.phase === Phases.Conflict,
                        onDeckShuffled: event => event.player === context.player && event.deck === Decks.ConflictDeck
                    },
                    effect: [
                        ability.effects.showTopConflictCard(),
                        ability.effects.canPlayFromOwn(Locations.ConflictDeck, [topCard])
                    ]
                };
            })
        });
    }
}

ArtisanAcademy.id = 'artisan-academy';

module.exports = ArtisanAcademy;


text:
import fs from 'fs'
import mkdirp from 'mkdirp'
import path from 'path'

// import constants from './app-constants'

exports.delete = function (path) {
  console.log('delete: ' + path)
  fs.unlinkSync(path)
}

exports.getFilenames = function (dir) {
  const list = fs.readdirSync(dir)
  return list.filter(
    function (value) {
      return fs.statSync(dir + '/' + value).isFile()
    }
  )
}

exports.getDataDir = function (app) {
  return app.getPath('userData')
}

exports.save = function (filename, txt) {
  console.log('>>save()')
  try {
    mkdirp(path.getDirName(path), function (err) {
      if (err) {
        throw err
      }
      fs.writeFileSync(path.join(this.getDataDir(), filename), txt, 'utf-8')
    })
    fs.writeFileSync(path.join(this.getDataDir(), filename), txt, 'utf-8')
  } catch (err) {
    throw err
  }
}

exports.saveWithBase64 = function (path, buf) {
  const b = new Buffer(buf)
  const b64Txt = b.toString('base64')
  var obj = { 'buf': b64Txt }
  try {
    fs.writeFileSync(path, JSON.stringify(obj), 'utf-8')
    console.log('Saved to' + path)
  } catch (err) {
    throw err
  }
}

exports.load = function (path) {
  const encoding = 'UTF-8'
  console.log('load:' + path)
  try {
    const jsonStr = fs.readFileSync(path, encoding)
    const json = JSON.parse(jsonStr.toString())
    const b = new Buffer(json['buf'], 'base64')
    return b.toString()
  } catch (err) {
    console.log(err)
    // return empty string when the buffer file is not found
    return ''
  }
}

exports.prepareDirIfNotExist = function (target) {
  mkdirp(target, function (err) {
    if (err) {
      throw err
    } else {
      // success
    }
  })
}


text:
<?php

namespace League\FactoryMuffin\Exceptions;

/**
 * This is the model not found exception class.
 *
 * This is thrown when we try to create an object, but the model class defined
 * was not found. This class extends ModelException, so you may want to try to
 * catch that exception instead, if you want to be more general.
 *
 * @author Graham Campbell <graham@alt-three.com>
 * @author Scott Robertson <scottymeuk@gmail.com>
 */
class ModelNotFoundException extends ModelException
{
    /**
     * Create a new model not found exception instance.
     *
     * @param string      $class   The model class name.
     * @param string|null $message The exception message.
     *
     * @return void
     */
    public function __construct($class, $message = null)
    {
        if (!$message) {
            $message = "The model class '$class' is undefined.";
        }

        parent::__construct($class, $message);
    }
}


text:
@interface SpectacleScreenDetection : NSObject

+ (NSScreen *)screenWithAction:(SpectacleWindowAction)action
                       andRect:(CGRect)rect
                       screens:(NSArray *)screens
                    mainScreen:(NSScreen *)mainScreen;

@end


text:
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Net;

namespace TestConsoleApplication.Spider
{
    public static class ProxyPool
    {
        private static List<string> _proxyList = new List<string>() { "61.93.246.50:8080", "218.57.200.15:8080" };
        private static Random _rand = new Random();
        private static string _proxyUrl = string.Empty;
        private static ActionScheduler _astFlushProxy = new ActionScheduler();
        private static ActionScheduler _astGetProxy = new ActionScheduler();
        private static ActionScheduler _astInsertProxy = new ActionScheduler();
        private static ActionScheduler _astPrintProxy = new ActionScheduler();

        public static ConcurrentDictionary<string, WebProxy> ProxyBag = new ConcurrentDictionary<string, WebProxy>();

        static ProxyPool()
        {
            _astGetProxy.Start(TimeSpan.FromSeconds(5), () => GetProxyList());
            _astInsertProxy.Start(TimeSpan.FromSeconds(5), () => InsertProxy());
            _astFlushProxy.Start(TimeSpan.FromSeconds(30), () => FlushProxy());
            _astPrintProxy.Start(TimeSpan.FromSeconds(30), () => PrintProxy());
        }

        public static WebProxy GetProxy()
        {
            if (ProxyBag.IsEmpty)
                return null;
            try
            {
                var proxyList = ProxyBag.Values.ToList();
                var proxy = proxyList[_rand.Next(0, proxyList.Count)];
                return proxy;
            }
            catch
            {
                return null;
            }
        }

        static void GetProxyList()
        {
            if (string.IsNullOrWhiteSpace(_proxyUrl))
                return;
            string proxyListText = string.Empty;
            //var proxyListText = HttpHelper.Get(_proxyUrl);
            if (string.IsNullOrWhiteSpace(proxyListText))
                return;

            var proxyList = proxyListText.Trim().Split(';');
            if (proxyList.Length > 0)
            {
                _proxyList.AddRange(proxyList);
                _proxyList = _proxyList.Distinct().ToList();
            }
        }

        static void InsertProxy()
        {
            if (_proxyList.Count > 0)
            {
                _proxyList.AsParallel().ForAll(proxyAddress =>
                {
                    if (CheckProxy(proxyAddress))
                    {
                        if (ProxyBag.ContainsKey(proxyAddress))
                            return;
                        ProxyBag[proxyAddress] = new WebProxy(proxyAddress);
                    }
                });
            }
        }

        static void FlushProxy()
        {
            foreach (var proxyAddress in ProxyBag.Keys)
            {
                WebProxy proxy = null;
                if (ProxyBag.TryGetValue(proxyAddress, out proxy))
                {
                    if (!CheckProxy(proxy))
                    {
                        Console.WriteLine($"{DateTime.Now}\tFlushProxy:{proxy.Address}被干掉");
                        ProxyBag.TryRemove(proxyAddress, out proxy);
                    }
                }
            }
        }

        static void PrintProxy()
        {
            ProxyBag.Keys.ToList().ForEach(proxy => Console.WriteLine($"Alive:{proxy}"));
        }

        static bool CheckProxy(string address)
        {
            if (string.IsNullOrWhiteSpace(address))
                return false;
            return CheckProxy(new WebProxy(address));
        }

        static bool CheckProxy(WebProxy proxy)
        {

            if (proxy == null)
                return false;
            var html = HttpHelper.Get("http://m.baidu.com/", retry: 2, proxy: proxy);
            var result = !string.IsNullOrWhiteSpace(html) && html.Length > 1000;//这里的1k是因为百度首页大概在1kb左右
            //Console.WriteLine($"{DateTime.Now}\tCheck:{proxy.Address}....{result}");
            return result;
        }
    }
}


text:
module Concerns
    module KondutoHandler
      extend ActiveSupport::Concern

      included do
        helper_method :render_konduto_script

        def render_konduto_script
          render_to_string(partial: 'layouts/konduto').html_safe
        end
      end
    end
  end


text:
        Component Display Name
        <input class="input setting-input" name="display_name" id="display_name" value="{display_name}" type="text" />

      The name students see. This name appears in the course ribbon and as a header for the Oppia exploration.

        Oppia Exploration ID
        <input class="input setting-input" name="oppiaid" id="oppiaid" value="{oppiaid}" type="text" />

      Example: a4j3jdj21tvv

        Oppia Server URL
        <input class="input setting-input" name="src" id="src" value="{src}" type="text" />

      Example: https://www.oppia.org

        Save

        Cancel


text:
package com.tobedevoured.modelcitizen.annotation;

/**
 * Place holder for default Class in annotations.
 */
public class NotSet {

	private NotSet() {

	}
}


text:
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("CodeTorch.Documents")]
[assembly: AssemblyDescription("This package provides support for storing documents in a database or Amazon S3")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyProduct("CodeTorch.Documents")]
[assembly: AssemblyCompany("Eminent Technology")]
[assembly: AssemblyCopyright("Copyright © Eminent Technology 2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components.  If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("113861f7-f361-4362-b7b7-4f08276e1d62")]

[assembly: AssemblyFileVersion("2.0.958")]
[assembly: AssemblyVersion("2.0.958")]


text:
/**
 *  @fileoverview Uses Gulpjs and gulp-inject to glob files
 *
 *  @author       Scott Nath
 *
 *  @requires     NPM:gulp-inject
 *  @requires     ./lib/get-options
 */

var inject = require('gulp-inject');
var mergeOptions = require('../get-options').mergeOptions;

/**
 * Gulp stream functionality which performs globbing/injecting pipeline
 *
 * @return {Object} true if gulp stream is complete
 *
 * @param {Object}  gulp  including file should inject the gulp module
 * @param {Object}  options  object of options
 */
function globInjectTask(gulp, options) {
  'use strict';
  var sources = gulp.src(options.files);

  return gulp.src(options.src)
    .pipe(inject(sources, options.config))
    .pipe(gulp.dest(options.dest));
}

/**
 * Function to get default options for an implementation of gulp-inject
 *
 * @return {Object}  options  an object of options
 */
var getDefaultOptions = function () {
  'use strict';
  var options = {
    config: {
      relative: true
    },
    src: './index.html', // source file with types of files to be glob-injected
    files: [// relative paths to files to be globbed
      '!./node_modules/**/*',
      '!./_gulp/*',
      './**/*'

    ],
    dest: './', // destination directory where we'll write our ammended source file
    taskName: 'file-glob-inject', // default task name
    dependencies: [] // gulp tasks which should be run before this task
  };

  return options;
};

/**
 * General gulp task to glob files
 *
 * @example
 * // include in gulpfile.js
 * require('pattern-library-utilities').gulpFileGlobInject(require('gulp'),globbingOptions);
 *
 * @param {Object} gulp including file should in inject the gulp module
 * @param {Object} projectOptions  object of options
 */
exports.gulpFileGlobInject = function (gulp, projectOptions) {
  'use strict';
  var options = mergeOptions(getDefaultOptions(), projectOptions);

  gulp.task(options.taskName, options.dependencies, function () {
    return globInjectTask(gulp, options);
  });
};

/**
 * Function to get default options for globbing scss files with gulp-inject
 *
 * @return {Object}  options  an object of default options
 */
var getDefaultScssOptions = function () {
  'use strict';
  var options = {
    config: {
      starttag: '// inject:{{ext}}',
      endtag: '// endinject',
      addRootSlash: false,
      relative: true,
      transform: function (filepath) {
        return '@import \'' + filepath + '\';';
      }
    },
    src: './styles/style.scss',
    files: [// Application scss files
      '!./node_modules/**/*',
      '!./styles/style.scss',
      './**/*.scss'
    ],
    dest: './styles',
    taskName: 'scss-glob-inject', // default task name
    dependencies: []
  };

  return options;
};

/**
 * Gulp task to glob scss files and write css imports
 *
 * @example
 * // include in gulpfile.js
 * require('pattern-library-utilities').gulpScssGlobInject(require('gulp'),scssGlobbingOptions);
 *
 * @param {Object} gulp including file should in inject the gulp module
 * @param {Object} projectOptions  object of options
 *
 */
exports.gulpScssGlobInject = function (gulp, projectOptions) {
  'use strict';
  var options = mergeOptions(getDefaultScssOptions(), projectOptions);

  gulp.task(options.taskName, options.dependencies, function () {
    return globInjectTask(gulp, options);
  });

};


text:
@interface MOBProjectionEPSG2466 : MOBProjection

@end


text:
<!DOCTYPE html>

  <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  <title>new post</title>

  <meta name="author" content="BANG SANG HUN" />
  <meta name="description" content="BANG sang hun." />
  <meta name="viewport" content="width=device-width, initial-scale=1.0">

  <link rel="alternate" type="application/rss+xml" href="/atom.xml" />

  <link href="/css/up.css" rel="stylesheet">

  <link rel="apple-touch-icon-precomposed" sizes="144x144" href="apple-touch-icon-144x144-precomposed.png">
  <link rel="apple-touch-icon-precomposed" sizes="114x114" href="apple-touch-icon-114x114-precomposed.png">
  <link rel="apple-touch-icon-precomposed" sizes="72x72" href="apple-touch-icon-72x72-precomposed.png">
  <link rel="apple-touch-icon-precomposed" href="apple-touch-icon-57x57-precomposed.png">
  <link rel="shortcut icon" href="/favicon.ico">

    <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-pages">
      Toggle navigation

    </button>
    BANG SANG HUN

    new post

    November 11, 2018

    Please enable JavaScript to view the comments powered by Disqus.
    comments powered by Disqus

<link href='http://fonts.googleapis.com/css?family=Open+Sans:400,300'
  rel='stylesheet' type='text/css'>


text:
import { takeLatest, takeEvery, take, put, select, call } from 'redux-saga/effects'
import {push } from 'react-router-redux'
import {
  redirectFromOrgIndexIfNeeded,
  resolveEnvUpdateConflicts
} from './helpers'
import {
  SOCKET_SUBSCRIBE_ORG_CHANNEL,
  SOCKET_SUBSCRIBE_ORG_USER_CHANNEL,
  SOCKET_SUBSCRIBE_OBJECT_CHANNEL,
  SOCKET_UNSUBSCRIBE_OBJECT_CHANNEL,
  SOCKET_ORG_UPDATE,
  SOCKET_BROADCAST_ENVS_STATUS,
  SOCKET_UPDATE_ENVS_STATUS,
  SOCKET_USER_SUBSCRIBED_OBJECT_CHANNEL,
  PROCESSED_SOCKET_UPDATE_ENVS_STATUS,
  SOCKET_UPDATE_LOCAL_STATUS,
  SOCKET_UNSUBSCRIBE_ALL,
  FETCH_OBJECT_DETAILS_SUCCESS,
  FETCH_CURRENT_USER_UPDATES_API_SUCCESS,
  fetchObjectDetails,
  fetchCurrentUser,
  fetchCurrentUserUpdates,
  socketBroadcastEnvsStatus,
  processedSocketUpdateEnvStatus,
  resetSession,
  selectOrg
} from 'actions'
import {
  getAuth,
  getCurrentOrg,
  getApp,
  getSelectedObject,
  getSelectedObjectType,
  getCurrentUser,
  getCurrentOrgUser,
  getCurrentAppUserForApp,
  getLocalSocketEnvsStatus,
  getEnvironmentLabelsWithSubEnvs,
  getAnonSocketEnvsStatus,
  getSelectedObjectId,
  getSubEnvs,
  getEnvActionsPendingByEnvUpdateId
} from 'selectors'
import {
  UPDATE_ENVS,
  UPDATE_ENVS_STATUS,
  ensureSocket,
  unsubscribeOrgChannels,
  subscribeOrgChannels,
  unsubscribeObjectChannel,
  subscribeObjectChannel,
  broadcastOrgChannel,
  broadcastObjectChannel
} from 'lib/socket'
import { allEntriesWithSubEnvs } from 'lib/env/query'
import { deanonymizeEnvStatus } from 'lib/env/update_status'
import {dispatchEnvUpdateRequestIfNeeded} from './helpers'

function *ensureSocketReady(){
  const auth = yield select(getAuth),
        currentOrg = yield select(getCurrentOrg)
  ensureSocket(auth, currentOrg.slug)
}

function *onSubscribeOrgChannel(){
  const currentOrg = yield select(getCurrentOrg),
        currentUser = yield select(getCurrentUser)
  yield call(ensureSocketReady)

  unsubscribeOrgChannels()
  subscribeOrgChannels(currentOrg, currentUser)
}

function *onUnsubscribeObjectChannel(){
  unsubscribeObjectChannel()
}

function *onUnsubscribeAll(){
  unsubscribeObjectChannel()
  unsubscribeOrgChannels()
}

function *onSubscribeObjectChannel({payload: object}){
  yield call(ensureSocketReady)
  subscribeObjectChannel(object)
}

function *onSocketUpdateOrg(action){
  const auth = yield select(getAuth),
        currentOrg = yield select(getCurrentOrg)

  // Cancel if not logged in / org selected
  if(!auth || !currentOrg)return

  const currentOrgUser = yield select(getCurrentOrgUser),
        selectedObjectId = yield select(getSelectedObjectId),
        {actorId, actionType, targetType, targetId, appId, meta} = action.payload

  // Do nothing if update message originated with this user
  if(auth.id == actorId)return

  // Handle org deleted
  if (actionType == "deleted" && targetType == "Org" && targetId == currentOrg.id){
    alert("This organization has been deleted by the owner.")
    yield put(push("/home"))
    yield put(resetSession())
    window.location.reload()
    return
  }

  // Handle lost org access
  if (actionType == "deleted" && targetType == "OrgUser" && targetId == currentOrgUser.id){
    alert("Your access to this organization has been removed by an org admin.")
    yield put(push("/home"))
    yield put(resetSession())
    window.location.reload()
    return
  }

  // Handle org access change
  if ((actionType == "created" && targetType == "OrgUser" && meta && meta.userId == auth.id) ||
      (actionType == "updated" && targetType == "Org" && meta && meta.updateType == "update_owner" && meta.userId == auth.id) ){
    alert("Your organization access level has been updated by an org admin.")
    yield put(push(`/${currentOrg.slug}`))
    window.location.reload()
    return
  }

  // Current app deleted
  if (actionType == "deleted" && targetType == "App" && targetId == selectedObjectId){
    alert("This app has been deleted by an org admin.")
    yield put(push(`/${currentOrg.slug}`))
    window.location.reload()
    return
  }

  // Current app access removed
  if (actionType == "deleted" && targetType == "AppUser" && appId == selectedObjectId && meta && meta.userId == auth.id){
    alert("Your access to this app has been removed by an app admin.")
    yield put(push(`/${currentOrg.slug}`))
    window.location.reload()
    return
  }

  // Current app access changed
  if (actionType == "created" && targetType == "AppUser" && meta && meta.userId == auth.id){
    yield put(fetchCurrentUserUpdates({noMinUpdatedAt: true}))
    if(appId == selectedObjectId){
      alert("Your app access level has been updated by an app admin.")
      window.location.reload()
    }
    return
  }

  // Selected user deleted
  if (actionType == "deleted" && targetType == "OrgUser" && meta && meta.userId == selectedObjectId){
    alert("This user has been removed from the organization by an org admin.")
    yield put(push(`/${currentOrg.slug}`))
    window.location.reload()
    return
  }

  // Env update
  if (actionType == "updated" && targetType == "App" && meta && meta.updateType == "update_envs"){
    let app = yield select(getApp(appId))

    if (app){
      const preUpdateEnvsWithMeta = app.envsWithMeta

      yield put(fetchObjectDetails({
        targetId,
        objectType: "app",
        decryptEnvs: true,
        socketUpdate: true,
        socketActorId: actorId,
        socketEnvUpdateId: meta.envUpdateId
      }))

      yield take(FETCH_OBJECT_DETAILS_SUCCESS)

      app = yield select(getApp(appId))
      const envActionsPending = yield select(getEnvActionsPendingByEnvUpdateId(appId, meta.envUpdateId)),
            hasConflict = yield call(resolveEnvUpdateConflicts, {
              envActionsPending,
              preUpdateEnvsWithMeta,
              envUpdateId: meta.envUpdateId,
              parentId: app.id,
              postUpdateEnvsWithMeta: app.envsWithMeta
            })

      if (hasConflict){
        return
      }

      yield call(dispatchEnvUpdateRequestIfNeeded, {
        parent: app,
        parentType: "app",
        parentId: targetId,
        skipDelay: true
      })
    }
    return
  }

  // Subscription updated
  const subscriptionUpdateTypes = ["upgrade_subscription", "update_subscription", "cancel_subscription", "trial_ended", "trial_started"]
  if (actionType == "updated" && targetType == "Org" && meta && subscriptionUpdateTypes.includes(meta.updateType)){
    yield put(fetchCurrentUserUpdates({noMinUpdatedAt: true}))
    return
  }

  if (actionType == "deleted" && !(meta && meta.bulkAction)){
    // Other deletes that are not bulk actions
    yield put(fetchCurrentUserUpdates({noMinUpdatedAt: true}))
  } else if (!(meta && meta.bulkAction)){
    // For other non-bulk changes, update in background
    yield put(fetchCurrentUserUpdates())
  }
}

function *onSocketUpdateEnvsStatus(action){
  const currentUser = yield select(getCurrentUser)

  if (!currentUser)return

  // Don't receive updates from current user broadcasts
  if (action.payload.userId == currentUser.id){
    return
  }

  const selectedObject = yield select(getSelectedObject),
        entries = yield call(allEntriesWithSubEnvs, selectedObject.envsWithMeta),
        selectedObjectType = yield select(getSelectedObjectType),
        environments = yield select(getEnvironmentLabelsWithSubEnvs(selectedObject.id)),
        subEnvs = yield select(getSubEnvs(selectedObject.id)),
        deanonStatus = deanonymizeEnvStatus(action.payload.status, entries, environments, subEnvs)

  yield put(processedSocketUpdateEnvStatus({status: deanonStatus, userId: action.payload.userId}))
}

function *onSocketBroadcastEnvsStatus(action){
  const {id: userId} = yield select(getAuth),
        anonStatus = yield select(getAnonSocketEnvsStatus)

  broadcastObjectChannel(userId, UPDATE_ENVS_STATUS, {status: anonStatus})
}

function *onSocketUserSubscribedObjectChannel(action){
  yield put(socketBroadcastEnvsStatus())
}

function *onSocketUpdateLocalStatus(action){
  const currentUser = yield select(getCurrentUser)
  if(!currentUser)return

  yield put(socketBroadcastEnvsStatus())
}

export default function* socketSagas(){
  yield [
    takeLatest(SOCKET_SUBSCRIBE_ORG_CHANNEL, onSubscribeOrgChannel),

    takeLatest(SOCKET_UNSUBSCRIBE_OBJECT_CHANNEL, onUnsubscribeObjectChannel),

    takeLatest(SOCKET_UNSUBSCRIBE_ALL, onUnsubscribeAll),

    takeLatest(SOCKET_SUBSCRIBE_OBJECT_CHANNEL, onSubscribeObjectChannel),

    takeEvery(SOCKET_ORG_UPDATE, onSocketUpdateOrg),

    takeEvery(SOCKET_UPDATE_ENVS_STATUS, onSocketUpdateEnvsStatus),

    takeEvery(SOCKET_UPDATE_LOCAL_STATUS, onSocketUpdateLocalStatus),

    takeEvery(SOCKET_BROADCAST_ENVS_STATUS, onSocketBroadcastEnvsStatus),

    takeEvery(SOCKET_USER_SUBSCRIBED_OBJECT_CHANNEL, onSocketUserSubscribedObjectChannel)
  ]
}


text:
RAILS_GEM_VERSION = ENV['MULTIRAILS_RAILS_VERSION'] if ENV['MULTIRAILS_RAILS_VERSION']

require File.join(File.dirname(__FILE__), 'boot')
require 'action_controller'

Rails::Initializer.run do |config|

  if ActionController::Base.respond_to? 'session='
    config.action_controller.session = {:session_key => '_app_session', :secret => '22cde4d5c1a61ba69a817953'}
  end

  config.load_paths << "#{RAILS_ROOT}/app/models/person" # moduleless model path
end

# Dependencies.log_activity = true

ENV['RAILS_ASSET_ID'] = Time.now.to_i.to_s

require 'tagging_extensions'


text:
package com.github.gwtd3.demo.client.testcases.scales;

import com.github.gwtd3.api.D3;
import com.github.gwtd3.api.arrays.Array;
import com.github.gwtd3.api.scales.ThresholdScale;
import com.github.gwtd3.demo.client.test.AbstractTestCase;
import com.google.gwt.user.client.ui.ComplexPanel;

public class TestThresholdScale extends AbstractTestCase {

	@Override
	public void doTest(final ComplexPanel sandbox) {
		// default domain and range, and apply functions
		ThresholdScale threshold = D3.scale.threshold();
		Array<?> domain = threshold.domain();
		assertEquals(1, domain.length());
		assertEquals(0.5, domain.getNumber(0));

		Array<?> range = threshold.range();
		assertEquals(2, range.length());
		assertEquals(0d, range.getNumber(0));
		assertEquals(1d, range.getNumber(1));

		assertEquals(0d, threshold.apply(0.49d).asDouble());
		assertEquals(1d, threshold.apply(0.51d).asDouble());

		// change domain and range
		threshold.domain(0.5, 0.8);
		assertEquals(0d, threshold.apply(0.48d).asDouble());
		assertEquals(1d, threshold.apply(0.51d).asDouble());
		// now undefined values are returned for input > 0.8
		assertTrue(threshold.apply(0.81).isUndefined());

		// setting range with 3 values
		threshold.range("a", "b", "c");
		assertEquals("a", threshold.apply(0.48d).asString());
		assertEquals("b", threshold.apply(0.51d).asString());
		assertEquals("c", threshold.apply(0.82d).asString());

		// invert extent
		assertEquals(0.5d, threshold.invertExtent("b").getNumber(0));
		assertEquals(0.8d, threshold.invertExtent("b").getNumber(1));

	}
}


text:
module SimpleApi
  module Sitemap
    class Reference < Sequel::Model
      set_dataset :refs
      many_to_one :index, class: 'SimpleApi::Sitemap::Index'
      # many_to_one :super_index, class: 'SimpleApi::Sitemap::Index'
      many_to_one :rule, class: 'SimpleApi::Rule'
      many_to_one :root, class: 'SimpleApi::Sitemap::Root'
    end
  end
end


text:
import os
import behaviroal_targeting
import ctr
import time

def main():
    while True:
        behaviroal_targeting.main()
        ctr.main()
        print "UPDATE."
        time.sleep(2)

if __name__ == "__main__":
    main()


text:
const chalk = require('chalk');

module.exports = function evaluate (exp, data) {
  const fn = new Function('data', 'with (data) { return ' + exp + '}')

  try {
    return fn(data);
  } catch (e) {
    console.error(chalk.red('Error when evaluating filter condition: ' + exp));
  }
}


text:
namespace blink {

// HeapMojoRemoteSet is a wrapper for mojo::RemoteSet to be owned by a
// garbage-collected object. Blink is expected to use HeapMojoRemoteSet by
// default. HeapMojoRemoteSet must be associated with context.
// HeapMojoRemoteSet's constructor takes context as a mandatory parameter.
// HeapMojoRemoteSet resets the mojo connection when the associated
// ExecutionContext is detached.

// TODO(crbug.com/1058076) HeapMojoWrapperMode should be removed once we ensure
// that the interface is not used after ContextDestroyed().
template <typename Interface,
          HeapMojoWrapperMode Mode = HeapMojoWrapperMode::kWithContextObserver>
class HeapMojoRemoteSet {
  DISALLOW_NEW();

 public:
  using DisconnectHandler =
      typename mojo::RemoteSet<Interface>::DisconnectHandler;
  using Iterator = typename mojo::RemoteSet<Interface>::Iterator;

  explicit HeapMojoRemoteSet(ContextLifecycleNotifier* notifier)
      : wrapper_(MakeGarbageCollected<Wrapper>(notifier)) {}
  HeapMojoRemoteSet(const HeapMojoRemoteSet&) = delete;
  HeapMojoRemoteSet& operator=(const HeapMojoRemoteSet&) = delete;
  HeapMojoRemoteSet(HeapMojoRemoteSet&&) = default;
  HeapMojoRemoteSet& operator=(HeapMojoRemoteSet&&) = default;

  // Methods to redirect to mojo::RemoteSet:
  void set_disconnect_handler(DisconnectHandler handler) {
    wrapper_->remote_set().set_disconnect_handler(std::move(handler));
  }

  mojo::RemoteSetElementId Add(mojo::Remote<Interface> remote) {
    return wrapper_->remote_set().Add(std::move(remote));
  }

  mojo::RemoteSetElementId Add(
      mojo::PendingRemote<Interface> remote,
      scoped_refptr<base::SequencedTaskRunner> task_runner) {
    DCHECK(task_runner);
    return wrapper_->remote_set().Add(std::move(remote), task_runner);
  }

  void Remove(mojo::RemoteSetElementId id) {
    wrapper_->remote_set().Remove(id);
  }

  bool Contains(mojo::RemoteSetElementId id) {
    return wrapper_->remote_set().Contains(id);
  }

  void Clear() { wrapper_->remote_set().Clear(); }

  bool empty() const { return wrapper_->remote_set().empty(); }
  size_t size() const { return wrapper_->remote_set().size(); }

  Iterator begin() { return wrapper_->remote_set().begin(); }
  Iterator begin() const { return wrapper_->remote_set().begin(); }
  Iterator end() { return wrapper_->remote_set().end(); }
  Iterator end() const { return wrapper_->remote_set().end(); }

  void Trace(Visitor* visitor) const { visitor->Trace(wrapper_); }

 private:
  FRIEND_TEST_ALL_PREFIXES(HeapMojoRemoteSetGCWithContextObserverTest,
                           NoClearOnConservativeGC);

  // Garbage collected wrapper class to add ContextLifecycleObserver.
  class Wrapper final : public GarbageCollected<Wrapper>,
                        public ContextLifecycleObserver {
   public:
    explicit Wrapper(ContextLifecycleNotifier* notifier) {
      SetContextLifecycleNotifier(notifier);
    }
    Wrapper(const Wrapper&) = delete;
    Wrapper& operator=(const Wrapper&) = delete;
    Wrapper(Wrapper&&) = default;
    Wrapper& operator=(Wrapper&&) = default;

    void Trace(Visitor* visitor) const override {
      ContextLifecycleObserver::Trace(visitor);
    }

    mojo::RemoteSet<Interface>& remote_set() { return remote_set_; }

    // ContextLifecycleObserver methods
    void ContextDestroyed() override {
      if (Mode == HeapMojoWrapperMode::kWithContextObserver)
        remote_set_.Clear();
    }

   private:
    mojo::RemoteSet<Interface> remote_set_;
  };

  Member<Wrapper> wrapper_;
};

}  // namespace blink

#endif  // THIRD_PARTY_BLINK_RENDERER_PLATFORM_MOJO_HEAP_MOJO_REMOTE_SET_H_


text:
/* ** GENEREATED FILE - DO NOT MODIFY ** */
package com.wilutions.mslib.office.impl;
import com.wilutions.com.*;

@SuppressWarnings("all")
@CoClass(guid="{C09B8E4C-A463-DB41-5DAE-69E7A5F7FCBC}")
public class IMsoChartGroupImpl extends Dispatch implements com.wilutions.mslib.office.IMsoChartGroup {
  @DeclDISPID(1610743808)  public void setAxisGroup(final Integer value) throws ComException {
    assert(value != null);
    this._dispatchCall(1610743808,"AxisGroup", DISPATCH_PROPERTYPUT,value);
  }
  @DeclDISPID(1610743808)  public Integer getAxisGroup() throws ComException {
    final Object obj = this._dispatchCall(1610743808,"AxisGroup", DISPATCH_PROPERTYGET,null);
    if (obj == null) return null;
    return (Integer)obj;
  }
  @DeclDISPID(1610743810)  public void setDoughnutHoleSize(final Integer value) throws ComException {
    assert(value != null);
    this._dispatchCall(1610743810,"DoughnutHoleSize", DISPATCH_PROPERTYPUT,value);
  }
  @DeclDISPID(1610743810)  public Integer getDoughnutHoleSize() throws ComException {
    final Object obj = this._dispatchCall(1610743810,"DoughnutHoleSize", DISPATCH_PROPERTYGET,null);
    if (obj == null) return null;
    return (Integer)obj;
  }
  @DeclDISPID(1610743812)  public com.wilutions.mslib.office.IMsoDownBars getDownBars() throws ComException {
    final Object obj = this._dispatchCall(1610743812,"DownBars", DISPATCH_PROPERTYGET,null);
    if (obj == null) return null;
    return Dispatch.as(obj, com.wilutions.mslib.office.impl.IMsoDownBarsImpl.class);
  }
  @DeclDISPID(1610743813)  public com.wilutions.mslib.office.IMsoDropLines getDropLines() throws ComException {
    final Object obj = this._dispatchCall(1610743813,"DropLines", DISPATCH_PROPERTYGET,null);
    if (obj == null) return null;
    return Dispatch.as(obj, com.wilutions.mslib.office.impl.IMsoDropLinesImpl.class);
  }
  @DeclDISPID(1610743814)  public void setFirstSliceAngle(final Integer value) throws ComException {
    assert(value != null);
    this._dispatchCall(1610743814,"FirstSliceAngle", DISPATCH_PROPERTYPUT,value);
  }
  @DeclDISPID(1610743814)  public Integer getFirstSliceAngle() throws ComException {
    final Object obj = this._dispatchCall(1610743814,"FirstSliceAngle", DISPATCH_PROPERTYGET,null);
    if (obj == null) return null;
    return (Integer)obj;
  }
  @DeclDISPID(1610743816)  public void setGapWidth(final Integer value) throws ComException {
    assert(value != null);
    this._dispatchCall(1610743816,"GapWidth", DISPATCH_PROPERTYPUT,value);
  }
  @DeclDISPID(1610743816)  public Integer getGapWidth() throws ComException {
    final Object obj = this._dispatchCall(1610743816,"GapWidth", DISPATCH_PROPERTYGET,null);
    if (obj == null) return null;
    return (Integer)obj;
  }
  @DeclDISPID(1610743818)  public void setHasDropLines(final Boolean value) throws ComException {
    assert(value != null);
    this._dispatchCall(1610743818,"HasDropLines", DISPATCH_PROPERTYPUT,value);
  }
  @DeclDISPID(1610743818)  public Boolean getHasDropLines() throws ComException {
    final Object obj = this._dispatchCall(1610743818,"HasDropLines", DISPATCH_PROPERTYGET,null);
    if (obj == null) return null;
    return (Boolean)obj;
  }
  @DeclDISPID(1610743820)  public void setHasHiLoLines(final Boolean value) throws ComException {
    assert(value != null);
    this._dispatchCall(1610743820,"HasHiLoLines", DISPATCH_PROPERTYPUT,value);
  }
  @DeclDISPID(1610743820)  public Boolean getHasHiLoLines() throws ComException {
    final Object obj = this._dispatchCall(1610743820,"HasHiLoLines", DISPATCH_PROPERTYGET,null);
    if (obj == null) return null;
    return (Boolean)obj;
  }
  @DeclDISPID(1610743822)  public void setHasRadarAxisLabels(final Boolean value) throws ComException {
    assert(value != null);
    this._dispatchCall(1610743822,"HasRadarAxisLabels", DISPATCH_PROPERTYPUT,value);
  }
  @DeclDISPID(1610743822)  public Boolean getHasRadarAxisLabels() throws ComException {
    final Object obj = this._dispatchCall(1610743822,"HasRadarAxisLabels", DISPATCH_PROPERTYGET,null);
    if (obj == null) return null;
    return (Boolean)obj;
  }
  @DeclDISPID(1610743824)  public void setHasSeriesLines(final Boolean value) throws ComException {
    assert(value != null);
    this._dispatchCall(1610743824,"HasSeriesLines", DISPATCH_PROPERTYPUT,value);
  }
  @DeclDISPID(1610743824)  public Boolean getHasSeriesLines() throws ComException {
    final Object obj = this._dispatchCall(1610743824,"HasSeriesLines", DISPATCH_PROPERTYGET,null);
    if (obj == null) return null;
    return (Boolean)obj;
  }
  @DeclDISPID(1610743826)  public void setHasUpDownBars(final Boolean value) throws ComException {
    assert(value != null);
    this._dispatchCall(1610743826,"HasUpDownBars", DISPATCH_PROPERTYPUT,value);
  }
  @DeclDISPID(1610743826)  public Boolean getHasUpDownBars() throws ComException {
    final Object obj = this._dispatchCall(1610743826,"HasUpDownBars", DISPATCH_PROPERTYGET,null);
    if (obj == null) return null;
    return (Boolean)obj;
  }
  @DeclDISPID(1610743828)  public com.wilutions.mslib.office.IMsoHiLoLines getHiLoLines() throws ComException {
    final Object obj = this._dispatchCall(1610743828,"HiLoLines", DISPATCH_PROPERTYGET,null);
    if (obj == null) return null;
    return Dispatch.as(obj, com.wilutions.mslib.office.impl.IMsoHiLoLinesImpl.class);
  }
  @DeclDISPID(1610743829)  public Integer getIndex() throws ComException {
    final Object obj = this._dispatchCall(1610743829,"Index", DISPATCH_PROPERTYGET,null);
    if (obj == null) return null;
    return (Integer)obj;
  }
  @DeclDISPID(1610743830)  public void setOverlap(final Integer value) throws ComException {
    assert(value != null);
    this._dispatchCall(1610743830,"Overlap", DISPATCH_PROPERTYPUT,value);
  }
  @DeclDISPID(1610743830)  public Integer getOverlap() throws ComException {
    final Object obj = this._dispatchCall(1610743830,"Overlap", DISPATCH_PROPERTYGET,null);
    if (obj == null) return null;
    return (Integer)obj;
  }
  @DeclDISPID(1610743832)  public IDispatch getRadarAxisLabels() throws ComException {
    final Object obj = this._dispatchCall(1610743832,"RadarAxisLabels", DISPATCH_PROPERTYGET,null);
    if (obj == null) return null;
    return (IDispatch)obj;
  }
  @DeclDISPID(1610743833)  public IDispatch SeriesCollection(final Object Index) throws ComException {
    assert(Index != null);
    final Object obj = this._dispatchCall(1610743833,"SeriesCollection", DISPATCH_METHOD,null,Variant.param(Index));
    if (obj == null) return null;
    return (IDispatch)obj;
  }
  @DeclDISPID(1610743834)  public com.wilutions.mslib.office.IMsoSeriesLines getSeriesLines() throws ComException {
    final Object obj = this._dispatchCall(1610743834,"SeriesLines", DISPATCH_PROPERTYGET,null);
    if (obj == null) return null;
    return Dispatch.as(obj, com.wilutions.mslib.office.impl.IMsoSeriesLinesImpl.class);
  }
  @DeclDISPID(1610743839)  public com.wilutions.mslib.office.IMsoUpBars getUpBars() throws ComException {
    final Object obj = this._dispatchCall(1610743839,"UpBars", DISPATCH_PROPERTYGET,null);
    if (obj == null) return null;
    return Dispatch.as(obj, com.wilutions.mslib.office.impl.IMsoUpBarsImpl.class);
  }
  @DeclDISPID(1610743840)  public void setVaryByCategories(final Boolean value) throws ComException {
    assert(value != null);
    this._dispatchCall(1610743840,"VaryByCategories", DISPATCH_PROPERTYPUT,value);
  }
  @DeclDISPID(1610743840)  public Boolean getVaryByCategories() throws ComException {
    final Object obj = this._dispatchCall(1610743840,"VaryByCategories", DISPATCH_PROPERTYGET,null);
    if (obj == null) return null;
    return (Boolean)obj;
  }
  @DeclDISPID(1610743842)  public com.wilutions.mslib.office.XlSizeRepresents getSizeRepresents() throws ComException {
    final Object obj = this._dispatchCall(1610743842,"SizeRepresents", DISPATCH_PROPERTYGET,null);
    if (obj == null) return null;
    return com.wilutions.mslib.office.XlSizeRepresents.valueOf((Integer)obj);
  }
  @DeclDISPID(1610743842)  public void setSizeRepresents(final com.wilutions.mslib.office.XlSizeRepresents value) throws ComException {
    assert(value != null);
    this._dispatchCall(1610743842,"SizeRepresents", DISPATCH_PROPERTYPUT,value.value);
  }
  @DeclDISPID(1610743844)  public void setBubbleScale(final Integer value) throws ComException {
    assert(value != null);
    this._dispatchCall(1610743844,"BubbleScale", DISPATCH_PROPERTYPUT,value);
  }
  @DeclDISPID(1610743844)  public Integer getBubbleScale() throws ComException {
    final Object obj = this._dispatchCall(1610743844,"BubbleScale", DISPATCH_PROPERTYGET,null);
    if (obj == null) return null;
    return (Integer)obj;
  }
  @DeclDISPID(1610743846)  public void setShowNegativeBubbles(final Boolean value) throws ComException {
    assert(value != null);
    this._dispatchCall(1610743846,"ShowNegativeBubbles", DISPATCH_PROPERTYPUT,value);
  }
  @DeclDISPID(1610743846)  public Boolean getShowNegativeBubbles() throws ComException {
    final Object obj = this._dispatchCall(1610743846,"ShowNegativeBubbles", DISPATCH_PROPERTYGET,null);
    if (obj == null) return null;
    return (Boolean)obj;
  }
  @DeclDISPID(1610743848)  public void setSplitType(final com.wilutions.mslib.office.XlChartSplitType value) throws ComException {
    assert(value != null);
    this._dispatchCall(1610743848,"SplitType", DISPATCH_PROPERTYPUT,value.value);
  }
  @DeclDISPID(1610743848)  public com.wilutions.mslib.office.XlChartSplitType getSplitType() throws ComException {
    final Object obj = this._dispatchCall(1610743848,"SplitType", DISPATCH_PROPERTYGET,null);
    if (obj == null) return null;
    return com.wilutions.mslib.office.XlChartSplitType.valueOf((Integer)obj);
  }
  @DeclDISPID(1610743850)  public Object getSplitValue() throws ComException {
    final Object obj = this._dispatchCall(1610743850,"SplitValue", DISPATCH_PROPERTYGET,null);
    if (obj == null) return null;
    return (Object)obj;
  }
  @DeclDISPID(1610743850)  public void setSplitValue(final Object value) throws ComException {
    assert(value != null);
    this._dispatchCall(1610743850,"SplitValue", DISPATCH_PROPERTYPUT,value);
  }
  @DeclDISPID(1610743852)  public Integer getSecondPlotSize() throws ComException {
    final Object obj = this._dispatchCall(1610743852,"SecondPlotSize", DISPATCH_PROPERTYGET,null);
    if (obj == null) return null;
    return (Integer)obj;
  }
  @DeclDISPID(1610743852)  public void setSecondPlotSize(final Integer value) throws ComException {
    assert(value != null);
    this._dispatchCall(1610743852,"SecondPlotSize", DISPATCH_PROPERTYPUT,value);
  }
  @DeclDISPID(1610743854)  public Boolean getHas3DShading() throws ComException {
    final Object obj = this._dispatchCall(1610743854,"Has3DShading", DISPATCH_PROPERTYGET,null);
    if (obj == null) return null;
    return (Boolean)obj;
  }
  @DeclDISPID(1610743854)  public void setHas3DShading(final Boolean value) throws ComException {
    assert(value != null);
    this._dispatchCall(1610743854,"Has3DShading", DISPATCH_PROPERTYPUT,value);
  }
  @DeclDISPID(148)  public IDispatch getApplication() throws ComException {
    final Object obj = this._dispatchCall(148,"Application", DISPATCH_PROPERTYGET,null);
    if (obj == null) return null;
    return (IDispatch)obj;
  }
  @DeclDISPID(149)  public Integer getCreator() throws ComException {
    final Object obj = this._dispatchCall(149,"Creator", DISPATCH_PROPERTYGET,null);
    if (obj == null) return null;
    return (Integer)obj;
  }
  @DeclDISPID(150)  public IDispatch getParent() throws ComException {
    final Object obj = this._dispatchCall(150,"Parent", DISPATCH_PROPERTYGET,null);
    if (obj == null) return null;
    return (IDispatch)obj;
  }
  @DeclDISPID(151)  public IDispatch CategoryCollection(final Object Index) throws ComException {
    assert(Index != null);
    final Object obj = this._dispatchCall(151,"CategoryCollection", DISPATCH_METHOD,null,Variant.param(Index));
    if (obj == null) return null;
    return (IDispatch)obj;
  }
  @DeclDISPID(152)  public IDispatch FullCategoryCollection(final Object Index) throws ComException {
    assert(Index != null);
    final Object obj = this._dispatchCall(152,"FullCategoryCollection", DISPATCH_METHOD,null,Variant.param(Index));
    if (obj == null) return null;
    return (IDispatch)obj;
  }
  public IMsoChartGroupImpl(String progId) throws ComException {
    super(progId, "{000C1727-0000-0000-C000-000000000046}");
  }
  protected IMsoChartGroupImpl(long ndisp) {
    super(ndisp);
  }
  public String toString() {
    return "[IMsoChartGroupImpl" + super.toString() + "]";
  }
}


text:
package org.apache.xmlbeans.impl.values;

import org.apache.xmlbeans.XmlError;

public class XmlValueOutOfRangeException extends IllegalArgumentException
{
    public XmlValueOutOfRangeException() {}
    public XmlValueOutOfRangeException(String message) { super(message); }
    public XmlValueOutOfRangeException(String code, Object[] args) { super(XmlError.formattedMessage(code, args)); }
}


text:
Реализован шаблонный класс матриц `Matrix`.

Поддерживаются операции:
- инициализация матрицы с помощью `std::initializer_list` в формате `{<число строк>, <число столбцов>, <элементы матрицы по строкам через запятую>}`;
- создание пустой матрицы заданного размера (матрица заполняется нулями);
- конструктор копирования;
- конструктор перемещения;
- оператор копирования;
- оператор перемещения;
- получение числа строк/столбцов;
- доступ к произвольному элементу по индексу (операция ``[][]`` реализована с помощью прокси-класса `MatrixRow`);
- сравнение матриц на равенство/неравенство;
- умножение на число (типа `T`);
- умножение на вектор (типа `T`);
- оператор вывода в поток (для отладки).

В случае выхода индекса за границы или умножения на вектор недопустимого размера возбуждается исключение.

Сборка:
```
$ make
```
Запуск:
```
$ ./test_matrix
```
При запуске происходит проверка реализованного класса. При успешном прохождении всех тестов выдается сообщение `All tests passed`, иначе - количество непройденных тестов.

Файл содержит реализацию классов `Matrix` и `MatrixRow`.