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

<?dlps id="WhaR2Co"?>
<?dlps page-images="none" figure-images="no"?>
<?dlps transcription="other"?>

<!DOCTYPE TEI.2 SYSTEM "http://text.lib.virginia.edu/dtd/tei/tei-p4/tei2.dtd" [
<!ENTITY % POSTKB "INCLUDE">
<!ENTITY % TEI.extensions.ent SYSTEM "http://text.lib.virginia.edu/dtd/tei/uva-dl-tei/uva-dl-tei.ent">
<!ENTITY % TEI.extensions.dtd SYSTEM "http://text.lib.virginia.edu/dtd/tei/uva-dl-tei/uva-dl-tei.dtd">
<!ENTITY % ISOnum SYSTEM "http://text.lib.virginia.edu/charent/iso-num.ent"> %ISOnum;
<!ENTITY % ISOpub SYSTEM "http://text.lib.virginia.edu/charent/iso-pub.ent"> %ISOpub;
]>

<TEI.2 id="WhaR2Co">
<teiHeader type="migrated" creator="Etext">
<fileDesc>
<titleStmt>
<title type="main">Mrs. Wharton's Manner</title>
<title type="sort">mrs whartons manner</title>
<author>Wharton review: Boynton, H. W.</author>
<respStmt>
<resp>Creation of machine-readable version:</resp>
<name>Judy Boss</name>
<resp>Conversion to TEI.2-conformant markup:</resp>
<name>University of Virginia Library Electronic Text Center.</name>
</respStmt>
</titleStmt>
<extent>ca. <num type="kilobytes">16</num> kilobytes</extent>
<publicationStmt>
<publisher>University of Virginia Library</publisher>
<pubPlace>Charlottesville, Virginia</pubPlace>
<idno type="ETC">WhaR2Co</idno>
<date value="1996">1996</date>
<availability status="public">

Copyright © 1996 by the Rector and Visitors of the University of Virginia

Publicly accessible

</availability>
<idno type="uva-pid">uva-lib:476520</idno>
</publicationStmt>
<seriesStmt>
<title>University of Virginia Library, Text collection</title>
<idno type="uva-set">UVA-LIB-Text</idno>
</seriesStmt>
<sourceDesc>
<biblFull>
<titleStmt>
<title type="main">Mrs. Wharton's Manner</title>
<title level="j">Nation. A Weekly Journal Devoted to Politics, Literature, Science, Drama, Music, Art, and Finance.</title>
<title type="sort">mrs whartons manner</title>
<author>H. W. Boynton</author>
</titleStmt>
<editionStmt>

1st Edition.

</editionStmt>
<publicationStmt>
<publisher>New York Evening Post Company</publisher>
<pubPlace>New York</pubPlace>
<date value="1913">1913</date>
</publicationStmt>
<seriesStmt>

<hi rend="italic">The Nation</hi> 97 (30 Oct. 1913): 404-05.

</seriesStmt>
<notesStmt>
<note>

UVa ed. AP2.N2

</note>
</notesStmt>
</biblFull>
</sourceDesc>
</fileDesc>
<encodingDesc>
<projectDesc>

Prepared for the University of Virginia Library Electronic Text Center.

</projectDesc>
<editorialDecl>

All quotation marks retained as data.

Spell-check and verification made
against printed text using WordPerfect spell checker.

All unambiguous end-of-line hyphens have been removed, and the
trailing part of a word has been joined to the preceding line.

Keywords in the header are a local Electronic Text Center scheme
to aid in establishing analytical groupings.

</editorialDecl>
<refsDecl>

ID elements are given for each page element and are composed of the text's
unique cryptogram and the given page number, as in AusEmma1 for page one of
Jane Austen's Emma.

</refsDecl>
</encodingDesc>
<profileDesc>
<creation>
<date value="1913">1913</date>
</creation>
<langUsage>
<language id="eng" usage="main">English</language>
</langUsage>
<textClass>
<keywords>
<term>non-fiction</term>
<term>prose</term>
<term>Women Writers</term>
</keywords>
</textClass>
</profileDesc>
<revisionDesc>
<change>
<date value="1996-03">March 1996</date>
<respStmt>
<resp>corrector</resp>
<name>Deirdre A. Johnson, Electronic Text Center, University of Virginia</name>
</respStmt>
<item>Added header and basic TEI markup</item>
</change>
<change>
<date value="2007-09">September 2007</date>
<respStmt>
<resp>Migration</resp>
<name>Ethan Gruber, University of Virginia Library</name>
</respStmt>
<item>Converted XML markup from TEI Lite to uva-dl-tei (TEI P4 with local customizations).</item>
</change>
<change>
<date value="2008-01">January 2008</date>
<respStmt>
<resp>Migration</resp>
<name>Greg Murray, University of Virginia Library</name>
</respStmt>
<item>Programmatically updated TEI header markup (but not header content) for minimal compliance with current QA requirements.</item>
</change>
</revisionDesc>
</teiHeader>

<text id="d1">

<div1 type="essay" id="d3"><pb n="404" id="WhaR2Co404"/>
           MRS. WHARTON'S MANNER.

Mrs. Wharton's early successes as a writer of short stories
were not the chance successes of a tyro. She had already served
her apprenticeship, without making the public pay for the crude
products of that trying phase of experience. She had learned what
she wanted to do, and how to do it. She could take a situation or
an episode involving two or three human figures, and wring the
truth from it—the truth as she personally saw it. She could drive
home her interpretation with witty phrase and epigram. She could
make people «sit up,» without the use of vulgar stimulants. If
there was one quality which pleased her audience more than her
brilliancy, it was her breeding. A final zest was given to the
enjoyment of her style by the sense that it was gentlemanlike.
That sense was misleading, of course, for she has always been
strongly feminine; but it is possible for a voice a trifle deeper
than common, a gesture somewhat more frank, to enhance the charm of
femininity by its hint of contradiction.

But beneath the suavity and self-possession of her manner
there has always been a restless spirit, and the time passed soon
when the exercise of wit and adroitness could soothe it. She had,
besides, the resources of the study, and the riches of art.
Turning from the short story to the novel, she called them to her
aid. She ranged herself in that school of sophistication, of
finesse, half-lights, and rich, dim accessories, which was then
ascendant. She knew her Meredith, her James, her Howells, and the
greater masters of France—Bourget, Stendhal, and the rest. She
wished to address herself to no vulgar audience. The very titles
of those earlier books, «The Greater Inclination,» «Crucial
Instances,» «The Valley of Decision,» were a snub to the populace
and a challenge to the fastidious. The populace does not deal in
comparatives, <hi rend="italic">nuances</hi>, reservations, compunctions.

There lies, however, between the reading masses and the small
choir of the elect, a surprising body of persons, chiefly feminine,
who aspire to sophistication and connoisseurship. The aspiration,
as applied to literature, was more fashionable ten years ago than
now, perhaps. Certainly a good many readers who aspired in that
way were attracted to Mrs. Wharton's earlier novels. To wander
through the pages of «The Valley of Decision,» for example, was to
breathe an atmosphere of polite and erudite adventure, in lands
where life had become a finished thing long before American crudity
began. It was not a very good story as a story; but the charm of
its style, of its leisurely winding along paths of old-world
glamour, was indubitable. There was something else—the occurrence
here and there of an episode vivid and telling, the work not of the
gentleman and scholar and agreeable cicerone, under whose guidance
we seemed, for the most part, to be quietly progressing, but of
Mrs. Wharton, the story-teller.

Looking back, from this remove, we suspect that those
episodes, so incidentally and even negligently vouchsafed, were the
most genuine part of the book: the rest, a brilliant <hi rend="italic">tour de
force</hi>. Its very elegance, its langour, its abstention from
display of wit or from excess of any sort, mark it as a feat. For
Mrs. Wharton is not a gentleman or a reflective philosopher. She
is a nervous, cultivated American woman, an extremely clever
performer on one of the favorite instruments of the hour: a
virtuoso, but in the popular sense of the word. And she has been
too clever not to find her way instinctively to the larger audience
which was ready for her.

With «The House of Mirth» she captured it. Here, almost in
the flesh, was that society to which striving America looks up with
delighted consternation. Here was a story of the «Four Hundred»
written from the inside, a moving picture of high life. It could
have been the work of no one but Mrs. Wharton, and yet was plainly
the work of another than the Mrs. Wharton of «The Dilettante» or
«The Valley of Decision.» Both her wit and her erudition were now
under better control. She no longer sparkled for the sake of
sparkling, or alluded for the sake of allusion. In fact, she must
have had a pretty clear notion of the audience she was addressing
and of its needs.

It was not an altogether different audience from her older
one; but it was wider, more various. The novelist, like the
playwright, must, if he expects to command a satisfactory hearing,
appeal, in some sense, to the mass as an individual. What Mr. A.
B. Walkley has said of the theatre audience applies, roughly, to
what may be called the magazine audience. The element of physical
contact and contagion is lacking; but the constituency of the news-stands does somehow pull together as one man. «A crowd,» Mr.
Walkley says, «forms a new entity, with a mind and character of its
own; it differs from the individuals composing it, just as our
bodies are unlike the cells of which they are made up, or just as
a chemical combination is unlike its separate ingredients.»

Before «The House of Mirth» Mrs. Wharton had not set herself
seriously to the task of captivating the magazine audience. She
had tickled its ears with her clever wisps of satire and badinage.
She had gone over its head entirely with «The Valley of Decision,»
and the books on Italy which followed. Now, at one stroke, she
succeeded in rousing it to excited attention with the «House of
Mirth.» Not that Mrs. Wharton abased herself to the magazine
manner. Her style was as finished and urbane as ever. But at last
its refinement was felt to be in keeping with the theme. Here, in
elegant black and white, were the superior beings to whom democracy
had hitherto been able to award only the humbler tributes of the
society column and <hi rend="italic">Town Topics</hi>.

The tale of Lily Bart could have been justified only as lifted
to the plane of tragedy. In Mrs. Wharton's hands, adroit as they
are, it remained sordid and vulgar. Something might have been done
with it in the way of uncompromising realism; so, at least, a
negative force and meaning might have been given to it. But in
attempting to employ the machinery of tragic romance, Mrs. Wharton
attempted the impossible. Lily is not a tragic figure, but a
feeble and paltry one. Such glamour as she has is the meretricious
glamour of social position; and this is true of all her «set.»

Perhaps Mrs. Wharton felt the irony of Lily's fame. No doubt
she was annoyed by the persistent attempts to give a local
habitation and a name to each of her imaginary figures of New York.
That was her penalty for not having made them also imaginative. At
all events, in «Madame de Treymes» she withdrew to a safer and
sounder field. Here, as in «Sanctuary,» she challenged the closest
comparison with Miss Anne Douglas Sedgwick (who, then irreproachable,<pb n="405" id="WhaR2Co405"/>
has since gained popularity with «Tante»). A
delicate study of old-world life on a comparatively small scale,
«Madame de Treymes» went its quiet way. But in «The Fruit of the
Tree» Mrs. Wharton again made, to speak coarsely, a hit. It was
not precisely the same kind of hit as that which she had scored in
«The House of Mirth.» It lacked two elements of popular appeal
which had counted in the earlier novel. It did not paint the
society of our dreams—that of New York and environs—and it did
not turn upon a problem of sex. But there was a problem—and it
interested the public because it was a problem which everybody has
attacked, however casually, and nobody has solved: is it right,
under any circumstance, to put a human being «out of misery»?
Unluckily, this is even less approachably a «well-made» novel than
«The House of Mirth.» Its six hundred odd pages contain material
for two distinct novels—or perhaps we should say for a dozen short
stories. And, as in «The House of Mirth,» its material was
presented with nothing more than cleverness—without the
transforming touch of imagination.

In «The Custom of the
Country,»<ref target="WhaR2Con2">*</ref>we are told, Mrs. Wharton has
returned to the field of «The House of Mirth.» We do not find this
to be literally true. The heroine of this story is not a Lily
Bart, but an Undine Spragg, of Apex City, Arizona. We find her in
New York, to be sure, bent upon breaking in among the best people.
In fact, when we meet her she has been there two years, with her
attendant parents, and has not yet broken in. But she is on the
eve of it. In a Bohemian circle to which she has penetrated, she
meets a fashionable portrait-painter, Claud Walsingham Popple, and
is much impressed with his fine presence and manners. Through him
she meets, and is not impressed by a real scion of the aristocracy,
Ralph Marvell. He at once, without other excuse than her crude
young beauty, falls in love with her; and as soon as she realizes
that he is «the real thing,» she succumbs.

Now, Undine Spragg is not a new type. We have met her
recently in many novels—in Mr. Herrick's «One Woman's Story,» in
Mr. Dreiser, in the recent «Joan Thursday» of Mr. Louis Joseph
Vance; in fact, wherever among our novelists realism continues to
rear its head. She is the daughter of the plain people, forging
towards success and happiness in the fashionable sense of the
terms. The thing that is hard to pardon in her is that she appears
a caricature instead of a refinement of that type. Undine Spragg
is as hard, as vulgar, as calculating, as selfish as any
professional daughter of pleasure could be. That she is physically
cold does not prevent her being twice divorced in pursuit of the
main chance, and finally falling back upon her first husband,
because he is not only a multi-millionaire, but the only person who
understands her. They are unmistakably a pair.

There is nothing to attach the deeper sympathies of the reader
to this person or to any other in the book. Paul Marvell, who dies
by his own hand, is well out of it, and that is all we feel: with
his elegance and sensitiveness, he shows the futility that besets
most of Mrs. Wharton's finer-grained male Americans. The Count de
Trezac, who succeeds him, is of similar type, except for the fact
that «the custom of the country,» with him, makes the family of
more importance than the wife, and so stiffens his backbone against
her encroachments. Most of the other figures in the book are
caricatured, from the masseuse and manicure artist, Mrs. Heeny, to
the unspeakable Van Degen.

With all its amenity of manner, «The Custom of the Country»
has a sharply satirical tone. The heroine is a mere monster of
vulgarity; and Mrs. Wharton seems to feel a ruthless satisfaction
in exposing her in all her enormity. The result is a defeat of
what should have been the main purpose, to <hi rend="italic">interest</hi> us in
the Spragg. A caricature does not remain interesting to the length
of six hundred pages. And there is no use trying to convey on
paper the charm of a physical beauty which has no backing in mind
or character. The mood of satire seems to be growing upon Mrs.
Wharton, a dubious sign in a writer who has passed a certain age.
It is hard to feel that, clever and effective and varied as her
work has been, and is, she has ever yet veritably «found herself»—
the self of assured power which seemed to exist potentially in her
first books. Ten years ago, a stranger asking an American who was
the most distinguished of our novelists would very likely have
heard the name of Mrs. Wharton. It is not altogether due to the
fact that other (potential) giants have arisen among us, that the
answer would now hardly be the same.

<signed>                    H. W. B.</signed>
</div1>

<back id="d4">
<div1 type="notes" id="d5">
	<note id="WhaR2Con2"><seg type="note-symbol">*</seg>
<hi rend="italic"> The Custom of the Country</hi>. By Edith Wharton. New
York: Charles Scribner's Sons.

</note>
</div1></back>

</text>
</TEI.2>


text:
using System;

namespace System.ServiceModel
{
    public enum CommunicationState
    {
        Created,
        Opening,
        Opened,
        Closing,
        Closed,
        Faulted
    }
}

redpajama_set_name: RedPajamaGithub


text:
/*
 ONOS GUI -- Util -- Theme Service
 */
(function () {
    'use strict';

    // injected refs
    var $log, fs, ps;

    // configuration
    var themes = ['light', 'dark'],
        themeStr = themes.join(' ');

    // internal state
    var listeners = [],
        currentTheme,
        thidx;

    function init() {
        thidx = ps.getPrefs('theme', { idx: 0 }).idx;
        updateBodyClass();
    }

    function getTheme() {
        return themes[thidx];
    }

    function setTheme(t, force) {
        var idx = themes.indexOf(t);
        if (force || idx > -1 && idx !== thidx) {
            thidx = idx;
            ps.setPrefs('theme', { idx: thidx });
            applyTheme();
        }
    }

    function toggleTheme() {
        var i = thidx + 1;
        thidx = (i===themes.length) ? 0 : i;
        ps.setPrefs('theme', { idx: thidx });
        applyTheme('toggle');
        return getTheme();
    }

    function applyTheme(evt) {
        thidx = ps.getPrefs('theme', { idx: thidx }).idx;
        if (currentTheme != thidx) {
            $log.info('Applying theme:', thidx);
            updateBodyClass();
            themeEvent(evt || 'set');
        }
    }

    function updateBodyClass() {
        var body = d3.select('body');
        body.classed(themeStr, false);
        body.classed(getTheme(), true);
        currentTheme = thidx;
    }

    function themeEvent(w) {
        var t = getTheme(),
            m = 'Theme-Change-(' + w + '): ' + t;
        $log.debug(m);

        listeners.forEach(function (lsnr) {
            lsnr({event: 'themeChange', value: t});
        });
    }

    function addListener(lsnr) {
        listeners.push(lsnr);
    }

    function removeListener(lsnr) {
        listeners = listeners.filter(function(obj) { return obj === lsnr; });
    }

    angular.module('onosUtil')
        .factory('ThemeService', ['$log', 'FnService', 'PrefsService',
        function (_$log_, _fs_, _ps_) {
            $log = _$log_;
            fs = _fs_;
            ps = _ps_;

            ps.addListener(applyTheme);

            return {
                init: init,
                theme: function (x) {
                    if (x === undefined) {
                        return getTheme();
                    } else {
                        setTheme(x);
                    }
                },
                toggleTheme: toggleTheme,
                addListener: addListener,
                removeListener: removeListener
            };
    }]);

}());


text:
#region Alchemi Copyright and License Notice

#endregion

using System;

namespace Alchemi.Core.Owner
{
    /// <summary>
    /// GApplicationBuffered class represents a buffered multi-use application.
    /// StartThread method has been overridden such that the thread is not immediately started rather
    /// it is placed in a thread buffer. When the thread buffer count reaches the thread buffer capacity
    /// then that thread buffer is sent to the manager as one thread. The GApplicationBuffered class
    /// should be used when there are many threads with short execution times. Under these conditions,
    /// using GApplicationBuffered class can significantly improve performance compared to
    /// using GApplication class.
    /// </summary>
    public class GApplicationBuffered : GApplication
    {
        private const int DefaultThreadBufferCapacity = 8;

        private GThreadBuffer _ThreadBuffer;
        private int _InternalThreadId;

        #region Constructors
        /// <summary>
        /// Default constructor.
        /// </summary>
        public GApplicationBuffered()
            : this(DefaultThreadBufferCapacity)
        {
        }

        /// <summary>
        /// Constructor that takes the given connection.
        /// </summary>
        /// <param name="connection">connection to alchemi manager</param>
        public GApplicationBuffered(GConnection connection)
            : this(DefaultThreadBufferCapacity)
        {
            if (connection == null)
            {
                throw new ArgumentNullException("connection may not be null");
            }

            Connection = connection;
        }

        /// <summary>
        /// Constructor that takes the given connection and the thread buffer capacity.
        /// </summary>
        /// <param name="connection"></param>
        /// <param name="threadBufferCapacity"></param>
        public GApplicationBuffered(GConnection connection, int threadBufferCapacity)
            : this(threadBufferCapacity)
        {
            if (connection == null)
            {
                throw new ArgumentNullException("connection");
            }

            Connection = connection;
        }

        /// <summary>
        /// Constructor that takes the thread buffer capacity.
        /// </summary>
        /// <param name="threadBufferCapacity">thread buffer capacity</param>
        public GApplicationBuffered(int threadBufferCapacity)
            : base(true)
        {
            if (threadBufferCapacity < 1)
            {
                throw new ArgumentOutOfRangeException("threadBufferCapacity", threadBufferCapacity, "0 < threadBufferCapacity <= Int32.MaxValue");
            }

            _threadBufferCapacity = threadBufferCapacity;
            _ThreadBuffer = CreateThreadBuffer();
        }
        #endregion

        #region Property - ThreadBufferCapacity
        private int _threadBufferCapacity;
        /// <summary>
        /// ThreadBufferCapacity property represents the thread buffer capacity.
        /// </summary>
        public int ThreadBufferCapacity
        {
            get { return _threadBufferCapacity; }
        }
        #endregion

        /// <summary>
        /// Starts the given thread indirectly by adding it to the thread buffer. When the thread buffer count reaches the thread buffer capacity then that thread buffer is sent to the manager as one thread.
        /// </summary>
        /// <param name="thread">thread</param>
        public override void StartThread(GThread thread)
        {
            lock (this)
            {
                // assign an internal thread id...
                thread.SetId(_InternalThreadId++);

                // add thread to thread buffer...
                _ThreadBuffer.Add(thread);
            }
        }

        /// <summary>
        /// Handles the thread buffer full event. It flushes the thread buffer.
        /// </summary>
        /// <param name="sender">sender</param>
        /// <param name="e">event args</param>
        private void ThreadBuffer_Full(object sender, EventArgs e)
        {
            FlushThreads();
        }

        /// <summary>
        /// Flushes the thread buffer by sending the thread buffer to the manager as one thread.
        /// </summary>
        public void FlushThreads()
        {
            lock (this)
            {
                // check whether any threads to flush...
                if (_ThreadBuffer.Count > 0)
                {
                    // remove full event handler from thread buffer...
                    _ThreadBuffer.Full -= new FullEventHandler(ThreadBuffer_Full);

                    // start thread buffer thread...
                    base.StartThread(_ThreadBuffer);

                    // create new thread buffer...
                    _ThreadBuffer = CreateThreadBuffer();
                }
            }
        }

        /// <summary>
        /// Creates a thread buffer.
        /// </summary>
        private GThreadBuffer CreateThreadBuffer()
        {
            GThreadBuffer oThreadBuffer = new GThreadBuffer(_threadBufferCapacity);
            oThreadBuffer.Full += new FullEventHandler(ThreadBuffer_Full);
            return oThreadBuffer;
        }

        /// <summary>
        /// Fires the thread finish event.
        /// </summary>
        /// <param name="thread">thread</param>
        protected override void OnThreadFinish(GThread thread)
        {
            GThreadBuffer oThreadBuffer = thread as GThreadBuffer;
            if (oThreadBuffer != null)
            {
                foreach (GThread oThread1 in oThreadBuffer)
                {
                    Exception oException = oThreadBuffer.GetException(oThread1.Id);
                    if (oException == null)
                    {
                        base.OnThreadFinish(oThread1);
                    }
                    else
                    {
                        base.OnThreadFailed(oThread1, oException);
                    }
                }
            }
        }

        /// <summary>
        /// Fires the thread failed event.
        /// </summary>
        /// <param name="thread">thread</param>
        /// <param name="ex">exception</param>
        protected override void OnThreadFailed(GThread thread, Exception ex)
        {
            GThreadBuffer oThreadBuffer = thread as GThreadBuffer;
            if (oThreadBuffer != null)
            {
                foreach (GThread oThread1 in oThreadBuffer)
                {
                    base.OnThreadFailed(oThread1, ex);
                }
            }
        }
    }
}


text:
package cl.ml.ceppi.core.model.cuota;

import java.io.Serializable;

import cl.ml.ceppi.core.model.estado.EstadoCuota;

/**
 *
 * @author Maldonado León
 *
 */
public class Cuota implements Serializable{

	private static final long serialVersionUID = -8313810574976479543L;
	private int oid;
	private ValorCuota valorCuota;
	private String periodo;
	private EstadoCuota estadoCuota;

	public Cuota() {
		// TODO Auto-generated constructor stub
	}

}


text:
<!DOCTYPE html>

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

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

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

<link href="../../../assets/css/fullscreen.css" rel="stylesheet" class="fullscreen"
type="text/css">

          	Quicknav
			      Quicknav

                  Design

Develop

Distribute

Links

Google Play Developer Console

Android Developers Blog

About Android

Android Sites

Android.com

Android Developers

Android Open Source Project

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

        close

Get Started

Style

Patterns

Building Blocks

Downloads

Videos

Training

API Guides

Reference

Tools

Get the SDK

Google Services

Google Play

Publishing

Promoting

App Quality

Spotlight

Open Distribution

Results

Loading...

Training

API Guides

Reference

Tools

Google Services

to top

          API level:

            <select id="apiLevelSelector">

            </select>

Android APIs

  android

  android.accessibilityservice

  android.accounts

  android.animation

  android.app

  android.app.admin

  android.app.backup

  android.appwidget

  android.bluetooth

  android.content

  android.content.pm

  android.content.res

  android.database

  android.database.sqlite

  android.drm

  android.gesture

  android.graphics

  android.graphics.drawable

  android.graphics.drawable.shapes

  android.graphics.pdf

  android.hardware

  android.hardware.display

  android.hardware.input

  android.hardware.location

  android.hardware.usb

  android.inputmethodservice

  android.location

  android.media

  android.media.audiofx

  android.media.effect

  android.mtp

  android.net

  android.net.http

  android.net.nsd

  android.net.rtp

  android.net.sip

  android.net.wifi

  android.net.wifi.p2p

  android.net.wifi.p2p.nsd

  android.nfc

  android.nfc.cardemulation

  android.nfc.tech

  android.opengl

  android.os

  android.os.storage

  android.preference

  android.print

  android.print.pdf

  android.printservice

  android.provider

  android.renderscript

  android.sax

  android.security

  android.service.dreams

  android.service.notification

  android.service.textservice

  android.service.wallpaper

  android.speech

  android.speech.tts

  android.support.v13.app

  android.support.v4.accessibilityservice

  android.support.v4.app

  android.support.v4.content

  android.support.v4.content.pm

  android.support.v4.database

  android.support.v4.graphics.drawable

  android.support.v4.hardware.display

  android.support.v4.media

  android.support.v4.net

  android.support.v4.os

  android.support.v4.print

  android.support.v4.text

  android.support.v4.util

  android.support.v4.view

  android.support.v4.view.accessibility

  android.support.v4.widget

  android.support.v7.app

  android.support.v7.appcompat

  android.support.v7.gridlayout

  android.support.v7.media

  android.support.v7.mediarouter

  android.support.v7.view

  android.support.v7.widget

  android.support.v8.renderscript

  android.telephony

  android.telephony.cdma

  android.telephony.gsm

  android.test

  android.test.mock

  android.test.suitebuilder

  android.text

  android.text.format

  android.text.method

  android.text.style

  android.text.util

  android.transition

  android.util

  android.view

  android.view.accessibility

  android.view.animation

  android.view.inputmethod

  android.view.textservice

  android.webkit

  android.widget

  dalvik.bytecode

  dalvik.system

  java.awt.font

  java.beans

  java.io

  java.lang

  java.lang.annotation

  java.lang.ref

  java.lang.reflect

  java.math

  java.net

  java.nio

  java.nio.channels

  java.nio.channels.spi

  java.nio.charset

  java.nio.charset.spi

  java.security

  java.security.acl

  java.security.cert

  java.security.interfaces

  java.security.spec

  java.sql

  java.text

  java.util

  java.util.concurrent

  java.util.concurrent.atomic

  java.util.concurrent.locks

  java.util.jar

  java.util.logging

  java.util.prefs

  java.util.regex

  java.util.zip

  javax.crypto

  javax.crypto.interfaces

  javax.crypto.spec

  javax.microedition.khronos.egl

  javax.microedition.khronos.opengles

  javax.net

  javax.net.ssl

  javax.security.auth

  javax.security.auth.callback

  javax.security.auth.login

  javax.security.auth.x500

  javax.security.cert

  javax.sql

  javax.xml

  javax.xml.datatype

  javax.xml.namespace

  javax.xml.parsers

  javax.xml.transform

  javax.xml.transform.dom

  javax.xml.transform.sax

  javax.xml.transform.stream

  javax.xml.validation

  javax.xml.xpath

  junit.framework

  junit.runner

  org.apache.http

  org.apache.http.auth

  org.apache.http.auth.params

  org.apache.http.client

  org.apache.http.client.entity

  org.apache.http.client.methods

  org.apache.http.client.params

  org.apache.http.client.protocol

  org.apache.http.client.utils

  org.apache.http.conn

  org.apache.http.conn.params

  org.apache.http.conn.routing

  org.apache.http.conn.scheme

  org.apache.http.conn.ssl

  org.apache.http.conn.util

  org.apache.http.cookie

  org.apache.http.cookie.params

  org.apache.http.entity

  org.apache.http.impl

  org.apache.http.impl.auth

  org.apache.http.impl.client

  org.apache.http.impl.conn

  org.apache.http.impl.conn.tsccm

  org.apache.http.impl.cookie

  org.apache.http.impl.entity

  org.apache.http.impl.io

  org.apache.http.io

  org.apache.http.message

  org.apache.http.params

  org.apache.http.protocol

  org.apache.http.util

  org.json

  org.w3c.dom

  org.w3c.dom.ls

  org.xml.sax

  org.xml.sax.ext

  org.xml.sax.helpers

  org.xmlpull.v1

  org.xmlpull.v1.sax2

Interfaces

ClipboardManager.OnPrimaryClipChangedListener

ComponentCallbacks

ComponentCallbacks2

ContentProvider.PipeDataWriter

DialogInterface

DialogInterface.OnCancelListener

DialogInterface.OnClickListener

DialogInterface.OnDismissListener

DialogInterface.OnKeyListener

DialogInterface.OnMultiChoiceClickListener

DialogInterface.OnShowListener

EntityIterator

IntentSender.OnFinished

Loader.OnLoadCanceledListener

Loader.OnLoadCompleteListener

ServiceConnection

SharedPreferences

SharedPreferences.Editor

SharedPreferences.OnSharedPreferenceChangeListener

SyncStatusObserver

Classes

AbstractThreadedSyncAdapter

AsyncQueryHandler

AsyncQueryHandler.WorkerArgs

AsyncQueryHandler.WorkerHandler

AsyncTaskLoader

BroadcastReceiver

BroadcastReceiver.PendingResult

ClipboardManager

ClipData

ClipData.Item

ClipDescription

ComponentName

ContentProvider

ContentProviderClient

ContentProviderOperation

ContentProviderOperation.Builder

ContentProviderResult

ContentQueryMap

ContentResolver

ContentUris

ContentValues

Context

ContextWrapper

CursorLoader

Entity

Entity.NamedContentValues

Intent

Intent.FilterComparison

Intent.ShortcutIconResource

IntentFilter

IntentFilter.AuthorityEntry

IntentSender

Loader

Loader.ForceLoadContentObserver

MutableContextWrapper

PeriodicSync

RestrictionEntry

SearchRecentSuggestionsProvider

SyncAdapterType

SyncContext

SyncInfo

SyncRequest

SyncRequest.Builder

SyncResult

SyncStats

UriMatcher

UriPermission

Exceptions

ActivityNotFoundException

IntentFilter.MalformedMimeTypeException

IntentSender.SendIntentException

OperationApplicationException

ReceiverCallNotAllowedException

      fullscreen
      Use Tree NavigationUse Panel Navigation

Summary:

  Methods

| [Expand All]

  Added in API level 1

    public
    static

    interface

DialogInterface.OnClickListener

        android.content.DialogInterface.OnClickListener

  Known Indirect Subclasses

              DatePickerDialog,

              DialogPreference,

              EditTextPreference,

              ListPreference,

              MultiSelectListPreference,

              Spinner,

              TimePickerDialog

              DatePickerDialog
              A simple dialog containing an DatePicker.

              DialogPreference
              A base class for Preference objects that are
 dialog-based.

              EditTextPreference
              A Preference that allows for string
 input.

              ListPreference
              A Preference that displays a list of entries as
 a dialog.

              MultiSelectListPreference
              A Preference that displays a list of entries as
 a dialog.

              Spinner
              A view that displays one child at a time and lets the user pick among them.

              TimePickerDialog
              A dialog that prompts the user for the time of day using a TimePicker.

Class Overview

Interface used to allow the creator of a dialog to run some code when an
 item on the dialog is clicked..

Summary

Public Methods

        <nobr>
            abstract

            void</nobr>

        <nobr>
        onClick(DialogInterface dialog, int which)</nobr>

This method will be invoked when a button in the dialog is clicked.

Public Methods

        public

        abstract

        void

      onClick
      (DialogInterface dialog, int which)

  Added in API level 1

This method will be invoked when a button in the dialog is clicked.

Parameters

          dialog
          The dialog that received the click.

          which
          The button that was clicked (e.g.
            BUTTON1) or the position
            of the item clicked.

  Except as noted, this content is licensed under Apache 2.0.
  For details and restrictions, see the
  Content License.

    Android 4.4 r1 —

    About Android  |
    Legal  |
    Support


text:
using System;

class PrintFirsAndLastName
{
    static void Main()
    {
        Console.WriteLine("Pesho Peshev");
    }
}


text:
<?xml version="1.0"?>
<config>
    <modules>
        <FZ_GoogleAnalytics>
            <active>true</active>
            <codePool>community</codePool>
            <depends>
                <Mage_Adminhtml/>
            </depends>
        </FZ_GoogleAnalytics>
    </modules>
</config>


text:
package io.fabric8.agent.resolver;

import org.osgi.framework.Constants;
import org.osgi.resource.Capability;
import org.osgi.resource.Resource;

import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.StringTokenizer;

public class CapabilityImpl extends BaseClause implements Capability {

    private final Resource m_resource;
    private final String m_namespace;
    private final Map<String, String> m_dirs;
    private final Map<String, Object> m_attrs;
    private final List<String> m_uses;
    private final List<List<String>> m_includeFilter;
    private final List<List<String>> m_excludeFilter;
    private final Set<String> m_mandatory;

    public CapabilityImpl(Capability capability) {
        this(null, capability.getNamespace(), capability.getDirectives(), capability.getAttributes());
    }

    public CapabilityImpl(Resource resource, String namespace,
                          Map<String, String> dirs, Map<String, Object> attrs) {
        m_namespace = namespace;
        m_resource = resource;
        m_dirs = dirs;
        m_attrs = attrs;

        // Find all export directives: uses, mandatory, include, and exclude.

        List<String> uses = Collections.emptyList();
        String value = m_dirs.get(Constants.USES_DIRECTIVE);
        if (value != null) {
            // Parse these uses directive.
            StringTokenizer tok = new StringTokenizer(value, ",");
            uses = new ArrayList<String>(tok.countTokens());
            while (tok.hasMoreTokens()) {
                uses.add(tok.nextToken().trim());
            }
        }
        m_uses = uses;

        value = m_dirs.get(Constants.INCLUDE_DIRECTIVE);
        if (value != null) {
            List<String> filters = ResourceBuilder.parseDelimitedString(value, ",");
            m_includeFilter = new ArrayList<List<String>>(filters.size());
            for (String filter : filters) {
                List<String> substrings = SimpleFilter.parseSubstring(filter);
                m_includeFilter.add(substrings);
            }
        } else {
            m_includeFilter = null;
        }

        value = m_dirs.get(Constants.EXCLUDE_DIRECTIVE);
        if (value != null) {
            List<String> filters = ResourceBuilder.parseDelimitedString(value, ",");
            m_excludeFilter = new ArrayList<List<String>>(filters.size());
            for (String filter : filters) {
                List<String> substrings = SimpleFilter.parseSubstring(filter);
                m_excludeFilter.add(substrings);
            }
        } else {
            m_excludeFilter = null;
        }

        Set<String> mandatory = Collections.emptySet();
        value = m_dirs.get(Constants.MANDATORY_DIRECTIVE);
        if (value != null) {
            List<String> names = ResourceBuilder.parseDelimitedString(value, ",");
            mandatory = new HashSet<String>(names.size());
            for (String name : names) {
                // If attribute exists, then record it as mandatory.
                if (m_attrs.containsKey(name)) {
                    mandatory.add(name);
                }
                // Otherwise, report an error.
                else {
                    throw new IllegalArgumentException("Mandatory attribute '" + name + "' does not exist.");
                }
            }
        }
        m_mandatory = mandatory;
    }

    public Resource getResource() {
        return m_resource;
    }

    public String getNamespace() {
        return m_namespace;
    }

    public Map<String, String> getDirectives() {
        return m_dirs;
    }

    public Map<String, Object> getAttributes() {
        return m_attrs;
    }

    public boolean isAttributeMandatory(String name) {
        return !m_mandatory.isEmpty() && m_mandatory.contains(name);
    }

    public List<String> getUses() {
        return m_uses;
    }

    public boolean isIncluded(String name) {
        if ((m_includeFilter == null) && (m_excludeFilter == null)) {
            return true;
        }

        // Get the class name portion of the target class.
        String className = getClassName(name);

        // If there are no include filters then all classes are included
        // by default, otherwise try to find one match.
        boolean included = (m_includeFilter == null);
        for (int i = 0; !included && m_includeFilter != null && i < m_includeFilter.size(); i++) {
            included = SimpleFilter.compareSubstring(m_includeFilter.get(i), className);
        }

        // If there are no exclude filters then no classes are excluded
        // by default, otherwise try to find one match.
        boolean excluded = false;
        for (int i = 0; (!excluded) && (m_excludeFilter != null) && (i < m_excludeFilter.size()); i++) {
            excluded = SimpleFilter.compareSubstring(m_excludeFilter.get(i), className);
        }
        return included && !excluded;
    }

    private static String getClassName(String className) {
        if (className == null) {
            className = "";
        }
        return (className.lastIndexOf('.') < 0) ? "" : className.substring(className.lastIndexOf('.') + 1);
    }

}


text:
app = {
    models: {},
};

app.openCamera = function(callback) {
    var messageHTML = [
        '

',
        'For best results:
',
        '
Look straight at the camera
',
        '
Center your face in the photo
',
        '
Keep a neutral expression
',
        '
'
    ].join('');
    var messageElement = $(messageHTML);
    var cameraDialog = bootbox.dialog({
        title: 'Take a Photo',
        message: messageElement,
        buttons: {
            'Take the photo!': {
                className: 'btn-success',
                callback: function() {
                    Webcam.snap(function(data_uri) {
                        Webcam.upload(data_uri, '/analyzePhoto', function(code, text) {
                            callback(JSON.parse(text));
                        } );
                    });
                }
            },
            'Cancel': {
                className: 'btn-danger'
            }
        }
    });

    cameraDialog.on('shown.bs.modal', function() {
        Webcam.set({
            width: 320,
            height: 240,
            dest_width: 640,
            dest_height: 480
        });
        Webcam.attach('#camera');
    });
};

ko.validation.init({
    decorateInputElement: true,
    errorAsTitle: false,
    messageTemplate: 'customValidationMessage'
});

ko.bindingHandlers.hidden = {
    update: function(element, valueAccessor, allBindings, viewModel, bindingContext) {
        ko.bindingHandlers.visible.update(element, function() {
            return !ko.utils.unwrapObservable(valueAccessor());
        }, allBindings, viewModel, bindingContext);
    }
};

ko.bindingHandlers.toggle = {
    init: function (element, valueAccessor) {
        var value = valueAccessor();
        ko.applyBindingsToNode(element, {
            click: function () {
                value(!value());
            }
        });
    }
};

ko.validation.rules.checkExists = {
    async: true,
    validator: function (val, url, callback) { // yes, you get a 'callback'
        var checkUrl = url+val;
        $.post(checkUrl, function(response) {
            callback({isValid: response.success, message: response.message});
        });
    },
    message: 'Already exists'
};
ko.validation.registerExtenders();

// Auto close flashed messages after 10 seconds
window.setTimeout(function() {
    $(".flashed-alert").fadeTo(500, 0).slideUp(500, function(){
        $(this).remove();
    });
}, 10000);


text:
package org.act.tstream.client.metric;

import com.codahale.metrics.Metric;

public interface MetricCallback<T extends Metric> {
	void callback(T metric);
}


text:
@import "https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css";
.midway-toolbar, .midway-tooltip {
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  box-sizing: border-box;
  position: absolute;
  top: 0;
  left: 0; }
  .midway-toolbar .inner, .midway-tooltip .inner {
    background-color: #262625;
    background-image: linear-gradient(to bottom, rgba(49, 49, 47, 0.99), #262625);
    background-repeat: repeat-x;
    border-radius: 5px; }
  .midway-toolbar .arrow-container, .midway-tooltip .arrow-container {
    position: absolute;
    bottom: -10px;
    left: 50%;
    clip: rect(10px 20px 20px 0);
    margin-left: -10px; }
    .midway-toolbar .arrow-container .arrow, .midway-tooltip .arrow-container .arrow {
      display: block;
      width: 20px;
      height: 20px;
      background-color: #262625;
      transform: rotate(45deg) scale(0.5); }

.midway-toolbar {
  display: none;
  z-index: 500;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none; }
  .midway-toolbar.active {
    display: inline-block;
    visibility: visible;
    transition: top 75ms ease-out, left 75ms ease-out;
    animation: pop-upwards 180ms forwards linear; }
    .midway-toolbar.active.virgin-toolbar {
      /** This toolbar is brand new, prevent transitioning its initial position, as it would then jump in from the top left corner **/
      transition: none; }
@keyframes pop-upwards {
  0% {
    transform: matrix(0.97, 0, 0, 1, 0, 12);
    opacity: 0; }
  20% {
    transform: matrix(0.99, 0, 0, 1, 0, 2);
    opacity: 0.7; }
  40% {
    transform: matrix(1, 0, 0, 1, 0, -1);
    opacity: 1; }
  70% {
    transform: matrix(1, 0, 0, 1, 0, 0);
    opacity: 1; }
  100% {
    transform: matrix(1, 0, 0, 1, 0, 0);
    opacity: 1; } }
  .midway-toolbar .buttons .button {
    display: inline-block;
    border: 0;
    color: #fff;
    height: 44px;
    line-height: 46px;
    vertical-align: middle;
    transition: .1s background-color, .1s border-color, .1s color, .1s fill;
    padding-left: 8px;
    padding-right: 8px;
    cursor: pointer; }
    .midway-toolbar .buttons .button:hover {
      color: #cbf6d1; }
    .midway-toolbar .buttons .button.active {
      color: #2ecc71; }
    .midway-toolbar .buttons .button:first-child {
      padding-left: 18px; }
    .midway-toolbar .buttons .button:last-child {
      padding-right: 18px; }
    .midway-toolbar .buttons .button.smaller i {
      font-size: 75%; }
    .midway-toolbar .buttons .button svg path {
      fill: #ccc; }
  .midway-toolbar .buttons .separator {
    display: inline-block;
    vertical-align: middle;
    width: 1px;
    margin: 0 6px;
    height: 24px;
    background: rgba(255, 255, 255, 0.2); }
  .midway-toolbar .link-input {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0; }
    .midway-toolbar .link-input .link-field {
      background: transparent;
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      padding: 13px 40px 11px 10px;
      color: #fff;
      border: none;
      outline: 0;
      font-size: 14px;
      box-sizing: border-box;
      border-radius: 5px;
      -webkit-appearance: none;
      -moz-appearance: none;
      appearance: none;
      font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
      letter-spacing: 0;
      font-weight: 400;
      font-style: normal;
      text-rendering: optimizeLegibility;
      -webkit-font-smoothing: antialiased;
      -moz-osx-font-smoothing: grayscale;
      -moz-font-feature-settings: "liga" on; }
    .midway-toolbar .link-input .link-cancel-btn {
      position: absolute;
      top: 0;
      right: 10px;
      bottom: 0;
      display: inline-block;
      border: 0;
      color: #fff;
      vertical-align: middle;
      line-height: 43px;
      cursor: pointer; }

.midway-tooltip {
  z-index: 450;
  padding-top: 10px; }
  .midway-tooltip .arrow-container {
    top: 0px;
    left: 50%;
    clip: auto; }
    .midway-tooltip .arrow-container .arrow {
      background-color: rgba(49, 49, 47, 0.99); }
  .midway-tooltip .inner {
    padding: 8px; }
  .midway-tooltip .inner, .midway-tooltip .inner a {
    position: relative;
    color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
    font-size: 12px;
    text-decoration: none; }
  .midway-tooltip .inner a {
    position: relative;
    cursor: pointer;
    z-index: 455; }

/*# sourceMappingURL=midway-toolbar.css.map */


text:
<?PHP

class Guest extends User
{

	public $restricted = true;

	public function __construct()
	{

		$this->DEBUG[] = "Instantiating Guest...";

		$this->_Data = $this->_getData( DEFAULT_GUEST_ID );

		$this->setData();

		$this->DEBUG[] = "Guest Instantiated!";

		CMS_Core::getInstance()->DEBUG[] = $this->DEBUG;

		return true;

	}

	public function setData()
	{

		$this->id = $this->_Data['id'];
		$this->fullName = $this->_Data['firstName'] . " " . $this->_Data['lastName'];
		$this->lastFirst = $this->_Data['lastName'] . ", " . $this->_Data['firstName'];

	}

}


text:
require('../typedefs');
const router = require('express').Router();
const mustBeAdmin = require('../middleware/must-be-admin');
const mustBeAuthenticated = require('../middleware/must-be-authenticated');
const wrap = require('../lib/wrap');

function removePassword(connection) {
  connection.password = '';
  if (connection.data && connection.data.password) {
    connection.data.password = '';
  }
  return connection;
}

/**
 * @param {Req} req
 * @param {Res} res
 */
async function listConnections(req, res) {
  const { models } = req;
  const connections = await models.connections.findAll();
  return res.utils.data(connections);
}

/**
 * @param {Req} req
 * @param {Res} res
 */
async function getConnection(req, res) {
  const { models } = req;
  const connection = await models.connections.findOneById(req.params.id);
  if (!connection) {
    return res.utils.data();
  }
  return res.utils.data(removePassword(connection));
}

/**
 * @param {Req} req
 * @param {Res} res
 */
async function createConnection(req, res) {
  const { models } = req;
  const newConnection = await models.connections.create(req.body);
  return res.utils.data(removePassword(newConnection));
}

/**
 * @param {Req} req
 * @param {Res} res
 */
async function updateConnection(req, res) {
  const { models } = req;
  let connection = await models.connections.findOneById(req.params.id);
  if (!connection) {
    return res.utils.notFound();
  }
  Object.assign(connection, req.body);
  connection = await models.connections.update(req.params.id, connection);
  return res.utils.data(removePassword(connection));
}

/**
 * @param {Req} req
 * @param {Res} res
 */
async function deleteConnection(req, res) {
  const { models, params } = req;
  let connection = await models.connections.findOneById(params.id);
  if (!connection) {
    return res.utils.notFound();
  }
  await models.connections.removeOneById(params.id);
  return res.utils.data();
}

router.get('/api/connections', mustBeAuthenticated, wrap(listConnections));
router.get('/api/connections/:id', mustBeAdmin, wrap(getConnection));
router.post('/api/connections', mustBeAdmin, wrap(createConnection));
router.put('/api/connections/:id', mustBeAdmin, wrap(updateConnection));
router.delete('/api/connections/:id', mustBeAdmin, wrap(deleteConnection));

module.exports = router;


text:
using Microsoft.Toolkit.Mvvm.ComponentModel;
using System.Collections.Generic;
using System.Linq;
using UWP.Models;

namespace UWP.ViewModels {
    partial class NewsViewModel : ObservableRecipient {

        [ObservableProperty]
        private List<NewsData> news = Enumerable.Repeat(new NewsData(), 30).ToList();

        public List<NewsCategories> Categories { get; set; }
        public List<string> Filters { get; set; } = new List<string>();
    }
}


text:
import React from 'react';
import PropTypes from 'prop-types';

import classNames from 'classnames';

const ChooseStars = (props) => {
    return (

            = 5})} id="5" onClick={props.onChangeRate}>☆
            = 4})} id="4" onClick={props.onChangeRate}>☆
            = 3})} id="3" onClick={props.onChangeRate}>☆
            = 2})} id="2" onClick={props.onChangeRate}>☆
            = 1})} id="1" onClick={props.onChangeRate}>☆

    )
};

ChooseStars.propTypes = {
    rate: PropTypes.number.isRequired,
    onChangeRate: PropTypes.func.isRequired,
};

export default ChooseStars;


text:
require 'net/http'
require 'open-uri'
require 'rubygems/package'
require 'zlib'
require 'fileutils'

# +----------------------------------------------------------------------+
# |  Licensed Materials - Property of IBM                                |
# |                                                                      |
# | (C) Copyright IBM Corporation 2006 - 2015                            |
# +----------------------------------------------------------------------+

TAR_LONGLINK = '././@LongLink'

WIN = RUBY_PLATFORM =~ /mswin/ || RUBY_PLATFORM =~ /mingw/

# use ENV['IBM_DB_HOME'] or latest db2 you can find
IBM_DB_HOME = ENV['IBM_DB_HOME']

machine_bits = ['ibm'].pack('p').size * 8

is64Bit = true

if machine_bits == 64
  is64Bit = true
  puts "Detected 64-bit Ruby\n "
else
  is64Bit = false
  puts "Detected 32-bit Ruby\n "
end

module Kernel
  def suppress_warnings
    origVerbosity = $VERBOSE
    $VERBOSE = nil
    result = yield
    $VERBOSE = origVerbosity
    return result
  end
end

DOWNLOADLINK = ''

if(RUBY_PLATFORM =~ /aix/i)
  #AIX
  if(is64Bit)
        puts "Detected platform - aix 64"
        DOWNLOADLINK = "http://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/aix64_odbc_cli.tar.gz"
  else
        puts "Detected platform - aix 32"
        DOWNLOADLINK = "http://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/aix32_odbc_cli.tar.gz"
  end
elsif (RUBY_PLATFORM =~ /powerpc/ || RUBY_PLATFORM =~ /ppc/)
  #PPC
  if(is64Bit)
        puts "Detected platform - ppc linux 64"
        DOWNLOADLINK = "http://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/ppc64_odbc_cli.tar.gz"
  else
        puts "Detected platform - ppc linux 64"
        DOWNLOADLINK = "http://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/ppc32_odbc_cli.tar.gz"
  end
elsif (RUBY_PLATFORM =~ /linux/)
  #x86
  if(is64Bit)
        puts "Detected platform - linux x86 64"
	DOWNLOADLINK = "http://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/linuxx64_odbc_cli.tar.gz"
  else
        puts "Detected platform - linux 32"
        DOWNLOADLINK = "http://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/linuxia32_odbc_cli.tar.gz"
  end
elsif (RUBY_PLATFORM =~ /sparc/i)
  #Solaris
  if(is64Bit)
        puts "Detected platform - sun sparc64"
        DOWNLOADLINK = "http://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/sun64_odbc_cli.tar.gz"
  else
        puts "Detected platform - sun sparc32"
        DOWNLOADLINK = "http://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/sun32_odbc_cli.tar.gz"
  end
elsif (RUBY_PLATFORM =~ /solaris/i)
  if(is64Bit)
        puts "Detected platform - sun amd64"
        DOWNLOADLINK = "http://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/sunamd64_odbc_cli.tar.gz"
  else
        puts "Detected platform - sun amd32"
        DOWNLOADLINK = "http://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/sunamd32_odbc_cli.tar.gz"
  end
end

def downloadCLIPackage(destination, link = nil)
  if(link.nil?)
    downloadLink = DOWNLOADLINK
  else
    downloadLink = link
  end

  uri = URI.parse(downloadLink)
  filename = "#{destination}/clidriver.tar.gz"

  headers = {
    'Accept-Encoding' => 'identity',
  }

  request = Net::HTTP::Get.new(uri.request_uri, headers)
  http = Net::HTTP.new(uri.host, uri.port)
  response = http.request(request)

  f = open(filename, 'wb')
  f.write(response.body)
  f.close()

  filename
end

def untarCLIPackage(archive,destination)
  Gem::Package::TarReader.new( Zlib::GzipReader.open(archive) ) do |tar|
    tar.each do |entry|
      file = nil
      if entry.full_name == $TAR_LONGLINK
        file = File.join destination, entry.read.strip
        next
      end
      file ||= File.join destination, entry.full_name
      if entry.directory?
        File.delete file if File.file? file
        FileUtils.mkdir_p file, :mode => entry.header.mode, :verbose => false
      elsif entry.file?
        FileUtils.rm_rf file if File.directory? file
        File.open file, "wb" do |f|
          f.print entry.read
        end
        FileUtils.chmod entry.header.mode, file, :verbose => false
      elsif entry.header.typeflag == '2' #Symlink!
        File.symlink entry.header.linkname, file
      end
    end
  end
end

if(IBM_DB_HOME == nil || IBM_DB_HOME == '')
  IBM_DB_INCLUDE = ENV['IBM_DB_INCLUDE']
  IBM_DB_LIB = ENV['IBM_DB_LIB']

  if( ( (IBM_DB_INCLUDE.nil?) || (IBM_DB_LIB.nil?) ) ||
      ( IBM_DB_INCLUDE == '' || IBM_DB_LIB == '' )
	)
	if(!DOWNLOADLINK.nil? && !DOWNLOADLINK.empty?)
		puts "Environment variable IBM_DB_HOME is not set. Downloading and setting up the DB2 client driver\n"
		destination = "#{File.expand_path(File.dirname(File.dirname(__FILE__)))}/../lib"

		archive = downloadCLIPackage(destination)
		untarCLIPackage(archive,destination)

		IBM_DB_HOME="#{destination}/clidriver"

		IBM_DB_INCLUDE = "#{IBM_DB_HOME}/include"
		IBM_DB_LIB="#{IBM_DB_HOME}/lib"
	else
		puts "Environment variable IBM_DB_HOME is not set. Set it to your DB2/IBM_Data_Server_Driver installation directory and retry gem install.\n "
		exit 1
	end
  end
else
  IBM_DB_INCLUDE = "#{IBM_DB_HOME}/include"

  if(is64Bit)
    IBM_DB_LIB="#{IBM_DB_HOME}/lib64"
  else
    IBM_DB_LIB="#{IBM_DB_HOME}/lib32"
  end
end

if( !(File.directory?(IBM_DB_LIB)) )
  suppress_warnings{IBM_DB_LIB = "#{IBM_DB_HOME}/lib"}
  if( !(File.directory?(IBM_DB_LIB)) )
    puts "Cannot find #{IBM_DB_LIB} directory. Check if you have set the IBM_DB_HOME environment variable's value correctly\n "
	exit 1
  end
  notifyString  = "Detected usage of IBM Data Server Driver package. Ensure you have downloaded "

  if(is64Bit)
    notifyString = notifyString + "64-bit package "
  else
    notifyString = notifyString + "32-bit package "
  end
  notifyString = notifyString + "of IBM_Data_Server_Driver and retry the 'gem install ibm_db' command\n "

  puts notifyString
end

if( !(File.directory?(IBM_DB_INCLUDE)) )
  puts " #{IBM_DB_HOME}/include folder not found. Check if you have set the IBM_DB_HOME environment variable's value correctly\n "
  exit 1
end

require 'mkmf'

dir_config('IBM_DB',IBM_DB_INCLUDE,IBM_DB_LIB)

def crash(str)
  printf(" extconf failure: %s\n", str)
  exit 1
end

if( RUBY_VERSION =~ /1.9/ || RUBY_VERSION =~ /2./)
  create_header('gil_release_version')
  create_header('unicode_support_version')
end

unless (have_library(WIN ? 'db2cli' : 'db2','SQLConnect') or find_library(WIN ? 'db2cli' : 'db2','SQLConnect', IBM_DB_LIB))
  crash(<<EOL)
Unable to locate libdb2.so/a under #{IBM_DB_LIB}

Follow the steps below and retry

Step 1: - Install IBM DB2 Universal Database Server/Client

step 2: - Set the environment variable IBM_DB_HOME as below

             (assuming bash shell)

             export IBM_DB_HOME=<DB2/IBM_Data_Server_Driver installation directory> #(Eg: export IBM_DB_HOME=/opt/ibm/db2/v10)

step 3: - Retry gem install

EOL
end

if(RUBY_VERSION =~ /2./)
	require 'rbconfig'
end

alias :libpathflag0 :libpathflag
def libpathflag(libpath)
if(RUBY_VERSION =~ /2./)
  ldflags =  case RbConfig::CONFIG["arch"]
  when /solaris2/
      libpath[0..-2].map {|path| " -R#{path}"}.join
    when /linux/
      libpath[0..-2].map {|path| " -R#{path} "}.join
    else
      ""
  end
else
	ldflags =  case Config::CONFIG["arch"]
	when /solaris2/
      libpath[0..-2].map {|path| " -R#{path}"}.join
    when /linux/
      libpath[0..-2].map {|path| " -R#{path} "}.join
    else
      ""
  end
end

  #libpathflag0 + " '-Wl,-R$$ORIGIN/clidriver/lib #{ldflags}' "
  libpathflag0 + " '-Wl,-R$$ORIGIN/clidriver/lib' "
end

have_header('gil_release_version')
have_header('unicode_support_version')

create_makefile('ibm_db')


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

<TITLE>
org.apache.nutch.api Class Hierarchy (apache-nutch 2.2.1 API)
</TITLE>

<META NAME="date" CONTENT="2013-06-27">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">

      Overview
      Package
      Class
      Use
    Tree
      Deprecated
      Index
      Help

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes

Hierarchy For Package org.apache.nutch.api

Package Hierarchies:
All Packages

Class Hierarchy

java.lang.Object

org.apache.nutch.api.DbReader
org.apache.nutch.api.JobStatus
org.apache.nutch.api.NutchServer
org.restlet.Restlet (implements org.restlet.Uniform)

org.restlet.Application

org.apache.nutch.api.NutchApp

org.restlet.resource.UniformResource

org.restlet.resource.ServerResource

org.apache.nutch.api.AdminResource
org.apache.nutch.api.APIInfoResource
org.apache.nutch.api.ConfResource
org.apache.nutch.api.DbResource
org.apache.nutch.api.JobResource

Interface Hierarchy

org.apache.nutch.api.ConfManager
org.apache.nutch.api.JobManager
org.apache.nutch.api.Params

Enum Hierarchy

java.lang.Object

java.lang.Enum<E> (implements java.lang.Comparable<T>, java.io.Serializable)

org.apache.nutch.api.JobManager.JobType
org.apache.nutch.api.JobStatus.State

      Overview
      Package
      Class
      Use
    Tree
      Deprecated
      Index
      Help

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes

Copyright © 2013 The Apache Software Foundation


text:
Library provides ability to play contract tests against a provider service in JUnit fashionable way.

Supports:

- Out-of-the-box convenient ways to load pacts

- Easy way to change assertion strategy

- **org.junit.BeforeClass**, **org.junit.AfterClass** and **org.junit.ClassRule** JUnit annotations, that will be run
once - before/after whole contract test suite.

- **org.junit.Before**, **org.junit.After** and **org.junit.Rule** JUnit annotations, that will be run before/after
each test of an interaction.

- **au.com.dius.pact.provider.junit.State** custom annotation - before each interaction that requires a state change,
all methods annotated by `@State` with appropriate the state listed will be invoked. These methods must either take
no parameters or a single Map parameter.

## Example of HTTP test

```java
    @RunWith(PactRunner.class) // Say JUnit to run tests with custom Runner
    @Provider("myAwesomeService") // Set up name of tested provider
    @PactFolder("pacts") // Point where to find pacts (See also section Pacts source in documentation)
    public class ContractTest {
        // NOTE: this is just an example of embedded service that listens to requests, you should start here real service
        @ClassRule //Rule will be applied once: before/after whole contract test suite
        public static final ClientDriverRule embeddedService = new ClientDriverRule(8332);

        @BeforeClass //Method will be run once: before whole contract test suite
        public static void setUpService() {
            //Run DB, create schema
            //Run service
            //...
        }

        @Before //Method will be run before each test of interaction
        public void before() {
            // Rest data
            // Mock dependent service responses
            // ...
            embeddedService.addExpectation(
                    onRequestTo("/data"), giveEmptyResponse()
            );
        }

        @State("default", "no-data") // Method will be run before testing interactions that require "default" or "no-data" state
        public void toDefaultState() {
            // Prepare service before interaction that require "default" state
            // ...
            System.out.println("Now service in default state");
        }

        @State("with-data") // Method will be run before testing interactions that require "with-data" state
        public void toStateWithData(Map data) {
            // Prepare service before interaction that require "with-data" state. The provider state data will be passed
            // in the data parameter
            // ...
            System.out.println("Now service in state using data " + data);
        }

        @TestTarget // Annotation denotes Target that will be used for tests
        public final Target target = new HttpTarget(8332); // Out-of-the-box implementation of Target (for more information take a look at Test Target section)
    }
```

## Example of AMQP Message test

```java
    @RunWith(PactRunner.class) // Say JUnit to run tests with custom Runner
    @Provider("myAwesomeService") // Set up name of tested provider
    @PactBroker(host="pactbroker", port = "80")
    public class ConfirmationKafkaContractTest {

        @TestTarget // Annotation denotes Target that will be used for tests
        public final Target target = new AmqpTarget(); // Out-of-the-box implementation of Target (for more information take a look at Test Target section)

        @BeforeClass //Method will be run once: before whole contract test suite
        public static void setUpService() {
            //Run DB, create schema
            //Run service
            //...
        }

        @Before //Method will be run before each test of interaction
        public void before() {
            // Message data preparation
            // ...
        }

        @PactVerifyProvider('an order confirmation message')
        String verifyMessageForOrder() {
            Order order = new Order()
            order.setId(10000004)
            order.setPrice(BigDecimal.TEN)
            order.setUnits(15)

            def message = new ConfirmationKafkaMessageBuilder()
              .withOrder(order)
              .build()

            JsonOutput.toJson(message)
        }

    }
```

## Pact source

The Pact runner will automatically collect pacts based on annotations on the test class. For this purpose there are 3
out-of-the-box options (files from a directory, files from a set of URLs or a pact broker) or you can easily add your
own Pact source.

**Note:** You can only define one source of pacts per test class.

### Download pacts from a pact-broker

To use pacts from a Pact Broker, annotate the test class with `@PactBroker(host="host.of.pact.broker.com", port = "80")`.

From _version 3.2.2/2.4.3+_ you can also specify the protocol, which defaults to "http".

The pact broker will be queried for all pacts with the same name as the provider annotation.

For example, test all pacts for the "Activity Service" in the pact broker:

```java
@RunWith(PactRunner.class)
@Provider("Activity Service")
@PactBroker(host = "localhost", port = "80")
public class PactJUnitTest {

  @TestTarget
  public final Target target = new HttpTarget(5050);

}
```

#### _Version 3.2.3/2.4.4+_ - Using Java System properties

The pact broker loader was updated to allow system properties to be used for the hostname, port or protocol. The port
was changed to a string to allow expressions to be set.

To use a system property or environment variable, you can place the property name in `${}` expression de-markers:

```java
@PactBroker(host="${pactbroker.hostname}", port = "80")
```

You can provide a default value by separating the property name with a colon (`:`):

```java
@PactBroker(host="${pactbroker.hostname:localhost}", port = "80")
```

#### _Version ???/???+_ - More Java System properties

The default values of the `@PactBroker` annotation now enable variable interpolation.
The following keys may be managed through the environment
* `pactbroker.host`
* `pactbroker.port`
* `pactbroker.protocol`
* `pactbroker.tags` (comma separated)
* `pactbroker.auth.scheme`
* `pactbroker.auth.username`
* `pactbroker.auth.password`

#### _Version 3.2.4/2.4.6+_ - Using tags with the pact broker

The pact broker allows different versions to be tagged. To load all the pacts:

```java
@PactBroker(host="pactbroker", port = "80", tags = {"latest", "dev", "prod"})
```

The default value for tags is `latest` which is not actually a tag but instead corresponds to the latest version ignoring the tags. If there are multiple consumers matching the name specified in the provider annotation then the latest pact for each of the consumers is loaded.

For any other value the latest pact tagged with the specified tag is loaded.

Specifying multiple tags is an OR operation. For example if you specify `tags = {"dev", "prod"}` then both the latest pact file tagged with `dev` and the latest pact file taggged with `prod` is loaded.

#### _Version 3.3.4/2.4.19+_ - Using basic auth with the with the pact broker

You can use basic authentication with the `@PactBroker` annotation by setting the `authentication` value to a `@PactBrokerAuth`
annotation. For example:

```java
@PactBroker(host = "${pactbroker.url:localhost}", port = "1234", tags = {"latest", "prod", "dev"},
  authentication = @PactBrokerAuth(username = "test", password = "test"))
```

The `username` and `password` values also take Java system property expressions.

### Pact Url

To use pacts from urls annotate the test class with

```java
@PactUrl(urls = {"http://build.server/zoo_app-animal_service.json"} )
```

### Pact folder

To use pacts from a resource folder of the project annotate test class with

```java
@PactFolder("subfolder/in/resource/directory")
```

### Custom pacts source

It's possible to use a custom Pact source. For this, implement interface `au.com.dius.pact.provider.junit.loader.PactLoader`
and annotate the test class with `@PactSource(MyOwnPactLoader.class)`. **Note:** class `MyOwnPactLoader` must have a default empty constructor or a constructor with one argument of class `Class` which at runtime will be the test class so you can get custom annotations of test class.

## Test target

The field in test class of type `au.com.dius.pact.provider.junit.target.Target` annotated with `au.com.dius.pact.provider.junit.target.TestTarget`
will be used for actual Interaction execution and asserting of contract.

**Note:** there must be exactly 1 such field, otherwise an `InitializationException` will be thrown.

### HttpTarget

`au.com.dius.pact.provider.junit.target.HttpTarget` - out-of-the-box implementation of `au.com.dius.pact.provider.junit.target.Target`
that will play pacts as http request and assert response from service by matching rules from pact.

_Version 3.2.2/2.4.3+_ you can also specify the protocol, defaults to "http".

### AmqpTarget

`au.com.dius.pact.provider.junit.target.AmqpTarget` - out-of-the-box implementation of `au.com.dius.pact.provider.junit.target.Target`
that will play pacts as an AMQP message and assert response from service by matching rules from pact.

#### Modifying the requests before they are sent [Version 3.2.3/2.4.5+]

Sometimes you may need to add things to the requests that can't be persisted in a pact file. Examples of these would
be authentication tokens, which have a small life span. The HttpTarget supports request filters by annotating methods
on the test class with `@TargetRequestFilter`. These methods must be public void methods that take a single HttpRequest
parameter.

For example:

```java
    @TargetRequestFilter
    public void exampleRequestFilter(HttpRequest request) {
      request.addHeader("Authorization", "OAUTH hdsagasjhgdjashgdah...");
    }
```

__*Important Note:*__ You should only use this feature for things that can not be persisted in the pact file. By modifying
the request, you are potentially modifying the contract from the consumer tests!

#### Turning off URL decoding of the paths in the pact file [version 3.3.3+]

By default the paths loaded from the pact file will be decoded before the request is sent to the provider. To turn this
behaviour off, set the system property `pact.verifier.disableUrlPathDecoding` to `true`.

__*Important Note:*__ If you turn off the url path decoding, you need to ensure that the paths in the pact files are
correctly encoded. The verifier will not be able to make a request with an invalid encoded path.

### Custom Test Target

It's possible to use custom `Target`, for that interface `Target` should be implemented and this class can be used instead of `HttpTarget`.

# Verification Reports [versions 3.2.7/2.4.9+]

The default test behaviour is to display the verification being done to the console, and pass or fail the test via the normal
JUnit mechanism. From versions 3.2.7/2.4.9+, additional reports can be generated from the tests.

## Enabling additional reports via annotations on the test classes

A `@VerificationReports` annotation can be added to any pact test class which will control the verification output. The
annotation takes a list report types and an optional report directory (defaults to "target/pact/reports").
The currently supported report types are `console`, `markdown` and `json`.

For example:

```java
@VerificationReports({"console", "markdown"})
public class MyPactTest {
```

will enable the markdown report in addition to the normal console output. And,

```java
@VerificationReports(value = {"markdown"}, reportDir = "/myreports")
public class MyPactTest {
```

will disable the normal console output and write the markdown reports to "/myreports".

## Enabling additional reports via Java system properties or environment variables

The additional reports can also be enabled with Java System properties or environment variables. The following two
properties have been introduced: `pact.verification.reports` and `pact.verification.reportDir`.

`pact.verification.reports` is the comma separated list of report types to enable (e.g. `console,json,markdown`).
`pact.verification.reportDir` is the directory to write reports to (defaults to "target/pact/reports").

## Additional Reports

The following report types are available in addition to console output (`console`, which is enabled by default):
`markdown`, `json`.

You can also provide a fully qualified classname as report so custom reports are also supported.
This class must implement `au.com.dius.pact.provider.reporters.VerifierReporter` interface in order to be correct custom implementation of a report.


text:
require 'dry/logic/predicates'
require 'hanami/utils/class_attribute'

module Hanami
  module Validations
    # Mixin to include when defining shared predicates
    #
    # @since 0.6.0
    #
    # @see Hanami::Validations::ClassMethods#predicates
    #
    # @example Inline Predicate
    #   require 'hanami/validations'
    #
    #   module MySharedPredicates
    #     include Hanami::Validations::Predicates
    #
    #     predicate :foo? do |actual|
    #       actual == 'foo'
    #     end
    #   end
    #
    #   class MyValidator
    #     include Hanami::Validations
    #     predicates MySharedPredicates
    #
    #     validations do
    #       required(:name).filled(:foo?)
    #     end
    #   end
    module Predicates
      # @since 0.6.0
      # @api private
      def self.included(base)
        base.class_eval do
          include Dry::Logic::Predicates
          include Utils::ClassAttribute

          class_attribute :messages
          class_attribute :messages_path
        end
      end
    end
  end
end


text:
package groovy.transform;

import org.codehaus.groovy.transform.GroovyASTTransformationClass;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * Class, method or constructor annotation which indicates that each parameter
 * should be checked to ensure it isn't null. If placed at the class level,
 * all explicit methods and constructors will be checked. Explicit means those
 * declared within the class and not inherited or added by transforms (but see {@link #includeGenerated()}).
 *

 * Example usage:
 *

 * import groovy.transform.NullCheck
 * import static groovy.test.GroovyAssert.shouldFail
 *
 * {@code @NullCheck}
 * class Greeter {
 *     private String audience
 *
 *     Greeter(String audience) {
 *         this.audience = audience.toLowerCase()
 *     }
 *
 *     String greeting(String salutation) {
 *         salutation.toUpperCase() + ' ' + audience
 *     }
 * }
 *
 * assert new Greeter('World').greeting('hello') == 'HELLO world'
 *
 * def ex = shouldFail(IllegalArgumentException) { new Greeter(null) }
 * assert ex.message == 'audience cannot be null'
 *
 * ex = shouldFail(IllegalArgumentException) { new Greeter('Universe').greeting(null) }
 * assert ex.message == 'salutation cannot be null'
 *

 * The produced code for the above example looks like this:
 *

 * class Greeter {
 *     private String audience
 *
 *     Foo(String audience) {
 *         if (audience == null) throw new IllegalArgumentException('audience cannot be null')
 *         this.audience = audience.toLowerCase()
 *     }
 *
 *     String greeting(String salutation) {
 *         if (salutation == null) throw new IllegalArgumentException('salutation cannot be null')
 *         salutation.toUpperCase() + ' ' + audience
 *     }
 * }
 *

 *
 * @since 3.0.0
 */
@java.lang.annotation.Documented
@Retention(RetentionPolicy.SOURCE)
@Target({ElementType.TYPE, ElementType.METHOD, ElementType.CONSTRUCTOR})
@GroovyASTTransformationClass("org.codehaus.groovy.transform.NullCheckASTTransformation")
public @interface NullCheck {
    /**
     * Whether to try to add null checking to generated methods/constructors such as those added by other transforms.
     * Using this option may lead to surprising results, e.g. it will only apply to methods/constructors added prior
     * to when the {@code NullCheck} transformation is processed.
     * Null checking is not enabled for constructors containing generated bytecode or
     * generated constructors with calls to this(...) or super(...) regardless of this flag.
     *
     * @since 3.0.2
     */
    boolean includeGenerated() default false;
}


text:
<?php
class Foo {
    function setHandler($handlerName, $handlerCode) {
        $this->handlerFunctions[$handlerName] = create_function('&$self, $dataArr', $handlerCode);
// NOTE: $this not allowed here, using $self as replacement
    }

    function executeHandler($handlerName, $dataArr) {
        if($this->handlerFunctions[$handlerName]) {
            $this->handlerFunctions[$handlerName](&$this, $dataArr);
        }
    }

    function getConstantInfo($what) {
        return($what);
    }
}

$bla = new Foo;

$bla->setHandler("load", 'echo($self->getConstantInfo("name")."\n");');
$bla->executeHandler("load", array("foo" => "bar"));
?>


text:
def obtain_torque_data(head, compute)

   ips, ip_roles = torque_parse_ips(head, compute)
   img_roles     = torque_parse_images(head, compute)
   return ips, ip_roles, img_roles

end

# Obtains the IP addresses from the resource[:head] and resource[:compute]
# arguments.
# torque { 'mytorque'
#   ...
#   head => ["155.210.155.73", "/var/tmp/master.img"],
#   compute => ["/files/compute-ip.txt", "/files/compute-img.txt"],
#   ...
# }
def torque_parse_ips(head, compute)

   ips_index = 0     # Because the IPs are in the first component of the head
                     # and compute arrays, and that is array[0]
   ips = []
   ip_roles = {}

   # Get the IPs that are under the "head" and "compute" attributes
   ip_roles[:head] = []
   ip_roles[:head] << head[ips_index].chomp

   path = compute[ips_index]
   ip_roles[:compute] = get_from_file(path)

   # Add the IPs to the array
   ips = ips + ip_roles[:head]
   ips = ips + ip_roles[:compute]

   ips = ips.uniq

   return ips, ip_roles

end

# Obtains the disk images from the resource[:head] and resource[:compute]
# arguments.
# torque { 'mytorque'
#   ...
#   head => ["155.210.155.73", "/var/tmp/master.img"],
#   compute => ["/files/compute-ip.txt", "/files/compute-img.txt"],
#   ...
# }
def torque_parse_images(head, compute)

   img_index = 1     # Because the images are in the first component of the head
                     # and compute arrays, and that is array[1]
   img_roles = {}

   # Get the disk images that are under the "head" and "compute" attributes
   img_roles[:head] = []
   img_roles[:head] << head[img_index].chomp

   path = compute[img_index]
   img_roles[:compute] = get_from_file(path)

   return img_roles

end

################################################################################
# Auxiliar functions
################################################################################

# Gets all the file lines in an array.
def get_from_file(path)

   array = []
   file = File.open(path)
   if file != nil
      array = file.readlines.map(&:chomp)    # Discard the final '\n'
      file.close
   end

   return array

end


text:
package com.java110.community.bmo.initializeBuildingUnit.impl;

import com.java110.community.bmo.initializeBuildingUnit.IinitializeBuildingUnitBmo;
import com.java110.core.factory.AuthenticationFactory;
import com.java110.dto.FloorDto;
import com.java110.dto.user.UserDto;
import com.java110.intf.community.IFloorInnerServiceSMO;
import com.java110.intf.community.IinitializeBuildingUnitSMO;
import com.java110.intf.fee.IInitializePayFeeInnerServiceSMO;
import com.java110.intf.user.IInitializeOwnerInnerServiceSMO;
import com.java110.intf.user.IUserInnerServiceSMO;
import com.java110.vo.ResultVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;

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

/**
 * 商户小区 查询实现类
 *

 * add by 吴学文 2020-12-23
 *

 * 文档参考:http://www.homecommunity.cn
 */
@Service
public class IinitializeBuildingUnitBmoImpl implements IinitializeBuildingUnitBmo {

    @Autowired
    private IinitializeBuildingUnitSMO initializeBuildingUnitSMOImpl;
    @Autowired
    private IFloorInnerServiceSMO floorInnerServiceSMOImpl;
    @Autowired
    private IInitializeOwnerInnerServiceSMO initializeOwnerInnerServiceSMOImpl;
    @Autowired
    private IInitializePayFeeInnerServiceSMO initializePayFeeInnerServiceSMOImpl;
    @Autowired
    private IUserInnerServiceSMO UserInnerServiceSMOImpl;
    @Override
    public ResponseEntity<String> deleteBuildingUnit(String communityId,String userId,String userPassword) {
        UserDto userDto = new UserDto();
        userDto.setUserId(userId);
        List<UserDto> userDtos = UserInnerServiceSMOImpl.getUserHasPwd(userDto);
        if(null == userDtos || userDtos.size() < 1){
            return ResultVo.createResponseEntity("没有查到用户信息,初始化失败!");
        }
        if(!AuthenticationFactory.passwdMd5(userPassword).equals(userDtos.get(0).getPassword())){
            return ResultVo.createResponseEntity("初始化时输入的密码不正确,初始化失败!");
        }
        StringBuffer massage = new StringBuffer();
        FloorDto floorDto = new FloorDto();
        floorDto.setCommunityId(communityId);
        List<FloorDto> floorDtos =  floorInnerServiceSMOImpl.queryFloors(floorDto);
        List floors = new ArrayList();
        int communitys = 0;
        if(null != floorDtos && floorDtos.size() > 0){
            for (FloorDto floorDtotmp: floorDtos){
                floors.add(floorDtotmp.getFloorId());
            }
            Map floorIds = new HashMap<String,String []>();
            floorIds.put("floorIds",floors.toArray(new String[floors.size()]));
            massage.append( "开始格式化小区数据:" );
            //单元
            communitys = initializeBuildingUnitSMOImpl.deleteBuildingUnit(floorIds);
        }

        massage.append("单元初始化完成,清理数据【"+communitys+"】条!");

        Map communityIds = new HashMap<String,String>();
        communityIds.put("communityId",communityId);
        //楼栋
        int deleteFlag = initializeBuildingUnitSMOImpl.deletefFloor(communityIds);
        massage.append("楼栋初始化完成,清理数据【"+deleteFlag+"】条!");
        //房屋
        int deleteFlagRoot = initializeBuildingUnitSMOImpl.deleteBuildingRoom(communityIds);
        massage.append("房屋初始化完成,清理数据【"+deleteFlagRoot+"】条!");
        //业主
        int deleteFlagOwner = initializeOwnerInnerServiceSMOImpl.deleteBuildingOwner(communityIds);
        massage.append("业主初始化完成,清理数据【"+deleteFlagOwner+"】条!");
        //费用
        int deleteFlagFee = initializePayFeeInnerServiceSMOImpl.deletePayFee(communityIds);
        massage.append("费用初始化完成,清理数据【"+deleteFlagFee+"】条!");

        //停车场
        int deleteFlagArea = initializeBuildingUnitSMOImpl.deleteParkingArea(communityIds);
        massage.append("停车场初始化完成,清理数据【"+deleteFlagArea+"】条!");

        //停车位
        int deleteFlagSpace = initializeBuildingUnitSMOImpl.deleteParkingSpace(communityIds);
        massage.append("停车位初始化完成,清理数据【"+deleteFlagSpace+"】条!");

        return ResultVo.createResponseEntity(massage);
    }

    public IinitializeBuildingUnitSMO getInitializeBuildingUnitSMOImpl() {
        return initializeBuildingUnitSMOImpl;
    }

    public void setInitializeBuildingUnitSMOImpl(IinitializeBuildingUnitSMO initializeBuildingUnitSMOImpl) {
        this.initializeBuildingUnitSMOImpl = initializeBuildingUnitSMOImpl;
    }

    public IFloorInnerServiceSMO getFloorInnerServiceSMOImpl() {
        return floorInnerServiceSMOImpl;
    }

    public void setFloorInnerServiceSMOImpl(IFloorInnerServiceSMO floorInnerServiceSMOImpl) {
        this.floorInnerServiceSMOImpl = floorInnerServiceSMOImpl;
    }

    public IInitializeOwnerInnerServiceSMO getInitializeOwnerInnerServiceSMOImpl() {
        return initializeOwnerInnerServiceSMOImpl;
    }

    public void setInitializeOwnerInnerServiceSMOImpl(IInitializeOwnerInnerServiceSMO initializeOwnerInnerServiceSMOImpl) {
        this.initializeOwnerInnerServiceSMOImpl = initializeOwnerInnerServiceSMOImpl;
    }

    public IInitializePayFeeInnerServiceSMO getInitializePayFeeInnerServiceSMOImpl() {
        return initializePayFeeInnerServiceSMOImpl;
    }

    public void setInitializePayFeeInnerServiceSMOImpl(IInitializePayFeeInnerServiceSMO initializePayFeeInnerServiceSMOImpl) {
        this.initializePayFeeInnerServiceSMOImpl = initializePayFeeInnerServiceSMOImpl;
    }

    public IUserInnerServiceSMO getUserInnerServiceSMOImpl() {
        return UserInnerServiceSMOImpl;
    }

    public void setUserInnerServiceSMOImpl(IUserInnerServiceSMO userInnerServiceSMOImpl) {
        UserInnerServiceSMOImpl = userInnerServiceSMOImpl;
    }
}


text:
import os
import unittest
import yaml
from .. import config_parser

class testConfigParser(unittest.TestCase):

    @classmethod
    def setUp(self):
        """Create a config file used for parsing"""
        self.config_file = '/tmp/test_config.yml'
        config = {
            'animal': 'cat',
            'location': '/tmp/foobar.txt',
            'values': ['a', 'b', 'c', 23],
            }
        with open(self.config_file, 'w') as filehandle:
            filehandle.write(yaml.dump(config, default_flow_style=False,))

    @classmethod
    def tearDown(self):
        """Delete test config file"""
        os.unlink(self.config_file)

    def test_configParser_basic(self):
        """Basic interface test"""
        config = config_parser.configParser(self.config_file)
        self.assertEqual(config.config['animal'], 'cat')
        self.assertEqual(config.animal, 'cat')
        self.assertListEqual(config.values, ['a', 'b', 'c', 23])

    def test_configParser_default(self):
        """Setting defaults"""
        config = config_parser.configParser(
            self.config_file,
            defaults = {'foobar': 'barfoo', 'animal': 'dog'}
        )
        # defaults do not overwrite the provided values
        self.assertEqual(config.config['animal'], 'cat')
        self.assertEqual(config.animal, 'cat')
        self.assertListEqual(config.values, ['a', 'b', 'c', 23])
        # if no value is provided, the default kicks in
        self.assertEqual(config.foobar, 'barfoo')

    def test_configParser_allowed_values(self):
        """Allowed values"""
        config = config_parser.configParser(
            self.config_file,
            allowed_values = {'animal': ['cat', 'dog', 'snake']}
        )
        with self.assertRaises(config_parser.IllegalConfigValue):
            config_parser.configParser(
                self.config_file,
                allowed_values = {'animal': ['dog', 'snake']})

    def test_configParser_required_keys(self):
        """Required keys"""
        config = config_parser.configParser(
            self.config_file,
            required_keys = ['animal', 'location']
        )
        with self.assertRaises(config_parser.MissingConfigValue):
            config_parser.configParser(
                self.config_file,
                required_keys = ['animal', 'location', 'foobar'])


text:
package org.freedesktop.dbus.connections;

import java.util.Map;
import java.util.Map.Entry;
import java.util.Optional;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;

import org.freedesktop.dbus.connections.config.ReceivingServiceConfig;
import org.freedesktop.dbus.connections.config.ReceivingServiceConfigBuilder;
import org.freedesktop.dbus.exceptions.IllegalThreadPoolStateException;
import org.freedesktop.dbus.utils.NameableThreadFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Service providing threads for every type of message expected to be received by DBus.
 *
 * @author hypfvieh
 * @version 4.1.0 - 2022-02-02
 */
public class ReceivingService {
    static final int MAX_RETRIES = 50;

    private final Logger logger = LoggerFactory.getLogger(getClass());

    private boolean closed = false;

    private final Map<ExecutorNames, ExecutorService> executors = new ConcurrentHashMap<>();

    private final IThreadPoolRetryHandler retryHandler;

    /**
     * Creates a new instance.
     *
     * @param _rsCfg configuration
     */
    ReceivingService(ReceivingServiceConfig _rsCfg) {
        ReceivingServiceConfig rsCfg = Optional.ofNullable(_rsCfg).orElse(ReceivingServiceConfigBuilder.getDefaultConfig());
        executors.put(ExecutorNames.SIGNAL, Executors.newFixedThreadPool(rsCfg.getSignalThreadPoolSize(), new NameableThreadFactory("DBus-Signal-Receiver-", true, rsCfg.getSignalThreadPriority())));
        executors.put(ExecutorNames.ERROR, Executors.newFixedThreadPool(rsCfg.getErrorThreadPoolSize(), new NameableThreadFactory("DBus-Error-Receiver-", true, rsCfg.getErrorThreadPriority())));

        // we need multiple threads here so recursive method calls are possible
        executors.put(ExecutorNames.METHODCALL, Executors.newFixedThreadPool(rsCfg.getMethodCallThreadPoolSize(), new NameableThreadFactory("DBus-MethodCall-Receiver-", true, rsCfg.getMethodCallThreadPriority())));
        executors.put(ExecutorNames.METHODRETURN, Executors.newFixedThreadPool(rsCfg.getMethodReturnThreadPoolSize(), new NameableThreadFactory("DBus-MethodReturn-Receiver-", true, rsCfg.getMethodReturnThreadPriority())));

        retryHandler = rsCfg.getRetryHandler();
    }

    /**
     * Execute a runnable which handles a signal.
     *
     * @param _r runnable
     *
     * @return retries, if any input was null -1 is returned
     */
    int execSignalHandler(Runnable _r) {
        return execOrFail(ExecutorNames.SIGNAL, _r);
    }

    /**
     * Execute a runnable which handles an error.
     *
     * @param _r runnable
     *
     * @return retries, if any input was null -1 is returned
     */
    int execErrorHandler(Runnable _r) {
        return execOrFail(ExecutorNames.ERROR, _r);
    }

    /**
     * Execute a runnable which handles a method call.
     *
     * @param _r runnable
     *
     * @return retries, if any input was null -1 is returned
     */
    int execMethodCallHandler(Runnable _r) {
       return execOrFail(ExecutorNames.METHODCALL, _r);
    }

    /**
     * Execute a runnable which handles the return of a method.
     *
     * @param _r runnable
     *
     * @return retries, if any input was null -1 is returned
     */
    int execMethodReturnHandler(Runnable _r) {
        return execOrFail(ExecutorNames.METHODRETURN, _r);
    }

    /**
     * Executes a runnable in a given executor.
     * May retry execution if {@link ExecutorService} has thrown an exception and retry handler
     * allows re-processing.
     * When re-processing fails for {@value #MAX_RETRIES} or more retries, an error will be logged
     * and the runnable will not be executed.
     *
     * @param _executor executor to use
     * @param _r runnable
     *
     * @return retries, if any input was null -1 is returned
     */
    int execOrFail(ExecutorNames _executor, Runnable _r) {
        if (_r == null || _executor == null) { // ignore invalid runnables or executors
            return -1;
        }

        int failCount = 0;
        while (failCount < MAX_RETRIES) {
            try {
                ExecutorService exec = getExecutor(_executor);
                if (exec == null) { // this should never happen, map is initialized in constructor
                    throw new IllegalThreadPoolStateException("No executor found for " + _executor);
                } else if (closed || exec.isShutdown() || exec.isTerminated()) {
                    throw new IllegalThreadPoolStateException("Receiving service already closed");
                }
                exec.execute(_r);
                break; // execution done, no retry needed
            } catch (IllegalThreadPoolStateException _ex) { // just throw our exception
                throw _ex;
            } catch (Exception _ex) {
                if (retryHandler == null) {
                    logger.error("Could not handle runnable for executor {}, runnable will be dropped", _executor, _ex);
                    break; // no handler, assume ignoring runnable is ok
                }

                failCount++;
                if (!retryHandler.handle(_executor, _ex)) {
                    logger.trace("Ignoring unhandled runnable for executor {} due to {}, dropped by retry handler after {} retries", _executor, _ex.getClass().getName(), failCount);
                    break;
                }
            }
        }

        if (failCount >= MAX_RETRIES) {
            logger.error("Could not handle runnable for executor {} after {} retries, runnable will be dropped", _executor, failCount);
        }

        return failCount;
    }

    /**
     * Returns the executor or null.
     *
     * @param _executor executor to use
     * @return executor or null
     */
    ExecutorService getExecutor(ExecutorNames _executor) {
        return executors.get(_executor);
    }

    /**
     * Shutdown all executor services waiting up to the given timeout/unit.
     *
     * @param _timeout timeout
     * @param _unit time unit
     */
    public synchronized void shutdown(int _timeout, TimeUnit _unit) {
        for (Entry<ExecutorNames, ExecutorService> es : executors.entrySet()) {
            logger.debug("Shutting down executor: {}", es.getKey());
            es.getValue().shutdown();
        }

        for (Entry<ExecutorNames, ExecutorService> es : executors.entrySet()) {
            try {
                es.getValue().awaitTermination(_timeout, _unit);
            } catch (InterruptedException _ex) {
                logger.debug("Interrupted while waiting for termination of executor");
            }
        }

        closed = true;
    }

    /**
     * Forcefully stop the executors.
     */
    public synchronized void shutdownNow() {
        for (Entry<ExecutorNames, ExecutorService> es : executors.entrySet()) {
            if (!es.getValue().isTerminated()) {
                logger.debug("Forcefully stopping {}", es.getKey());
                es.getValue().shutdownNow();
            }
        }

        closed = true;
    }

    /**
     * Enum representing different executor services.
     *
     * @author hypfvieh
     * @version 4.0.1 - 2022-02-02
     */
    public enum ExecutorNames {
        SIGNAL("SignalExecutor"),
        ERROR("ErrorExecutor"),
        METHODCALL("MethodCallExecutor"),
        METHODRETURN("MethodReturnExecutor");

        private final String description;

        ExecutorNames(String _name) {
            description = _name;
        }

        public String getDescription() {
            return description;
        }

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

    /**
     * Interface which specifies a handler which will be called when the thread pool throws any exception.
     *
     * @author hypfvieh
     * @since 4.2.0 - 2022-07-14
     */
    @FunctionalInterface
    public interface IThreadPoolRetryHandler {
        /**
         * Called to handle an exception.
         * <p>
         * This method should return true to retry execution or false to
         * just ignore the error and drop the unhandled message.
         * </p>
         *
         * @param _executor the executor which has thrown the exception
         * @param _ex the exception which was thrown
         *
         * @return true to retry execution of the failed runnable, false to ignore runnable
         */
        boolean handle(ExecutorNames _executor, Exception _ex);
    }

}


text:
package com.ethanco.json.convertor.convert;

/**
 * 如果是Object对象,则先转换为json字符串后,再转换为byte[]
 *
 * @author EthanCo
 * @since 2017/1/20
 */

public class ObjectJsonByteConvertor extends ObjectJsonConvertor {
    @Override
    public Object sentConvert(Object message) {
        Object result = super.sentConvert(message);
        if (result instanceof String) {
            return ((String) result).getBytes();
        }
        return result;
    }
}


text:
/// Copyright (c) 2012 Ecma International.  All rights reserved.
/**
 * @path ch15/15.4/15.4.4/15.4.4.22/15.4.4.22-5-9.js
 * @description Array.prototype.reduceRight - 'initialValue' is returned if 'len' is 0 and 'initialValue' is present
 */

function testcase() {

        var initialValue = 10;
        return initialValue === [].reduceRight(function () { }, initialValue);
    }
runTestCase(testcase);