text:
#import <XCTest/XCTest.h>

#import "SPTDataLoaderRateLimiter+Private.h"
#import "SPTDataLoaderTimeProviderImplementation.h"
#import "SPTDataLoaderTimeProviderMock.h"

#import <SPTDataLoader/SPTDataLoaderRequest.h>

@interface SPTDataLoaderRateLimiterTest : XCTestCase

@property (nonatomic, strong) SPTDataLoaderTimeProviderMock *timeProvider;
@property (nonatomic, strong) SPTDataLoaderRateLimiter *rateLimiter;
@property (nonatomic, assign) double requestsPerSecond;

@end

@implementation SPTDataLoaderRateLimiterTest

#pragma mark XCTestCase

- (void)setUp
{
    [super setUp];
    self.requestsPerSecond = 10.0;
    self.timeProvider = [SPTDataLoaderTimeProviderMock new];
    self.rateLimiter = [[SPTDataLoaderRateLimiter alloc] initWithDefaultRequestsPerSecond:self.requestsPerSecond
                                                                             timeProvider:self.timeProvider];
}

#pragma mark SPTDataLoaderRateLimiterTest

- (void)testNotNil
{
    XCTAssertNotNil(self.rateLimiter, @"The rate limiter should not be nil after construction");
}

- (void)testRateLimiterWithDefaultRequestsPerSecondUseExpectedTimeLimiter
{
    // Given
    Class expectedTimeProviderClass = [SPTDataLoaderTimeProviderImplementation class];

    // When
    SPTDataLoaderRateLimiter *const rateLimiter = [SPTDataLoaderRateLimiter rateLimiterWithDefaultRequestsPerSecond:self.requestsPerSecond];

    // Then
    XCTAssert([rateLimiter.timeProvider isKindOfClass:expectedTimeProviderClass], @"The default timeProvider used by the class method should be a SPTDataLoaderTimeProviderImplementation");
}

- (void)testEarliestTimeUntilRequestCanBeRealisedWithRetryAfter
{
    // Given
    NSURL *URL = [NSURL URLWithString:@"https://spclient.wg.spotify.com/thingy"];
    SPTDataLoaderRequest *request = [SPTDataLoaderRequest requestWithURL:URL sourceIdentifier:nil];
    NSTimeInterval seconds = 60.0;
    CFAbsoluteTime retryAfter = self.timeProvider.currentTime + seconds;

    // When
    [self.rateLimiter setRetryAfter:retryAfter forURL:URL];

    // Then
    NSTimeInterval earliestTime = [self.rateLimiter earliestTimeUntilRequestCanBeExecuted:request];
    XCTAssertEqualWithAccuracy(earliestTime, seconds, 1.0, @"The retry-after limitation was not respected by the rate limiter");
}

- (void)testEarliestTimeWithCurrentTimeMovingBackwards
{
    // Given
    self.timeProvider.currentTime = 100;
    const double timeDelta = -100;
    NSURL *URL = [NSURL URLWithString:@"https://spclient.wg.spotify.com/thingy"];
    SPTDataLoaderRequest *request = [SPTDataLoaderRequest requestWithURL:URL sourceIdentifier:nil];
    [self.rateLimiter executedRequest:request];

    // When
    self.timeProvider.currentTime += timeDelta;

    // Then
    NSTimeInterval earliestTime = [self.rateLimiter earliestTimeUntilRequestCanBeExecuted:request];
    XCTAssertEqualWithAccuracy(earliestTime, 0, 0.000000001, @"The earliestTime is not 0 although the currentTime is less than the time of the last request executed");
}

- (void)testEarliestTimeWithCurrentTimeMovingForwardLessThanCutoffTime
{
    // Given
    self.timeProvider.currentTime = 100;
    const CFAbsoluteTime cutoffTime = 0.1; // as we set 10 requests per second
    const CFAbsoluteTime timeDelta = 0.02;
    NSURL *URL = [NSURL URLWithString:@"https://spclient.wg.spotify.com/thingy"];
    SPTDataLoaderRequest *request = [SPTDataLoaderRequest requestWithURL:URL sourceIdentifier:nil];
    [self.rateLimiter executedRequest:request];

    // When
    self.timeProvider.currentTime += timeDelta;

    // Then
    NSTimeInterval earliestTime = [self.rateLimiter earliestTimeUntilRequestCanBeExecuted:request];
    XCTAssertEqualWithAccuracy(earliestTime, cutoffTime - timeDelta, 0.000000001, @"The earliestTime is not equal to the remaining part of the curoffTime");
}

- (void)testEarliestTimeWithCurrentTimeMovingForwardMoreThanCutoffTime
{
    // Given
    self.timeProvider.currentTime = 100;
    const CFAbsoluteTime timeDelta = 100;
    NSURL *URL = [NSURL URLWithString:@"https://spclient.wg.spotify.com/thingy"];
    SPTDataLoaderRequest *request = [SPTDataLoaderRequest requestWithURL:URL sourceIdentifier:nil];
    [self.rateLimiter executedRequest:request];

    // When
    self.timeProvider.currentTime -= timeDelta;

    // Then
    NSTimeInterval earliestTime = [self.rateLimiter earliestTimeUntilRequestCanBeExecuted:request];
    XCTAssertEqualWithAccuracy(earliestTime, 0, 0.000000001, @"The earliestTime is not 0 although longer than the cutoff time has passed");
}

- (void)testEarliestTimeUntilRequestCanBeRealised
{
    // Given
    NSURL *URL = [NSURL URLWithString:@"https://spclient.wg.spotify.com/thingy"];
    SPTDataLoaderRequest *request = [SPTDataLoaderRequest requestWithURL:URL sourceIdentifier:nil];

    // When
    [self.rateLimiter executedRequest:request];

    // Then
    NSTimeInterval earliestTime = [self.rateLimiter earliestTimeUntilRequestCanBeExecuted:request];
    NSString *earliestTimeWithDecimalPrecision = [NSString stringWithFormat:@"%0.1f", earliestTime];
    XCTAssertEqualObjects(earliestTimeWithDecimalPrecision, @"0.1", @"The requests per second limitation was not respected by the rate limiter");
}

- (void)testExecutedRequestWithNilRequest
{
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wnonnull"
    // Test no crash
    [self.rateLimiter executedRequest:nil];
#pragma clang diagnostic pop
}

- (void)testRequestsPerSecondDefault
{
    // Given
    NSURL *URL = [NSURL URLWithString:@"https://spclient.wg.spotify.com/thingy"];

    // When
    double requestsPerSecond = [self.rateLimiter requestsPerSecondForURL:URL];

    // Then
    XCTAssertEqualWithAccuracy(requestsPerSecond, self.requestsPerSecond, 1.0, @"The requests per second for a URL is not falling back to the default specified in the class constructor");
}

- (void)testRequestsPerSecondCustom
{
    // Given
    NSURL *URL = [NSURL URLWithString:@"https://spclient.wg.spotify.com/thingy"];
    double requestsPerSecond = 20.0;

    // When
    [self.rateLimiter setRequestsPerSecond:requestsPerSecond forURL:URL];

    // Then
    double reportedRequestsPerSecond = [self.rateLimiter requestsPerSecondForURL:URL];
    XCTAssertEqualWithAccuracy(requestsPerSecond, reportedRequestsPerSecond, 1.0, @"The requests per second for this URL was not what was explicitly set");
}

- (void)testSetRetryAfterWithNilURL
{
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wnonnull"
    // Test no crash
    [self.rateLimiter setRetryAfter:60.0 forURL:nil];
#pragma clang diagnostic pop
}

- (void)testResetRetryAfterAfterSuccessfulExecution
{
    // Given
    NSURL *URL = [NSURL URLWithString:@"https://spclient.wg.spotify.com/thingy"];
    SPTDataLoaderRequest *request = [SPTDataLoaderRequest requestWithURL:URL sourceIdentifier:nil];
    NSTimeInterval seconds = 60.0;
    CFAbsoluteTime retryAfter = self.timeProvider.currentTime + seconds;

    // When
    [self.rateLimiter setRetryAfter:retryAfter forURL:URL];
    [self.rateLimiter executedRequest:request];

    // Then
    NSTimeInterval earliestTime = [self.rateLimiter earliestTimeUntilRequestCanBeExecuted:request];
    XCTAssertEqualWithAccuracy(earliestTime, 0.0, 1.0, @"The earliest time until request can be executed was not reset despite an overwrite of the retry-after rule");
}

@end


text:
"""
Wrapper for PyICU word segmentation. This wrapper module uses
:class:`icu.BreakIterator` with Thai as :class:`icu.Local`
to locate boundaries between words from the text.

:See Also:
    * `GitHub repository <https://github.com/ovalhub/pyicu>`_
"""
import re
from typing import List

from icu import BreakIterator, Locale

def _gen_words(text: str) -> str:
    bd = BreakIterator.createWordInstance(Locale("th"))
    bd.setText(text)
    p = bd.first()
    for q in bd:
        yield text[p:q]
        p = q

def segment(text: str) -> List[str]:
    """
    :param str text: text to be tokenized to words
    :return: list of words, tokenized from the text
    """
    if not text or not isinstance(text, str):
        return []

    text = re.sub("([^\u0E00-\u0E7F\n ]+)", " \\1 ", text)

    return list(_gen_words(text))

redpajama_set_name: RedPajamaGithub


text:
#include "lib.h"
#include "toolcontext.h"
#include "segtype.h"
#include "display.h"
#include "text_export.h"
#include "text_import.h"
#include "config.h"
#include "str_list.h"
#include "targets.h"
#include "lvm-string.h"
#include "activate.h"
#include "str_list.h"
#include "metadata.h"

static const char *_unknown_name(const struct lv_segment *seg)
{

	return seg->segtype->name;
}

static int _unknown_text_import(struct lv_segment *seg, const struct config_node *sn,
				struct dm_hash_table *pv_hash)
{
	struct config_node *new, *last = NULL, *head = NULL;
	const struct config_node *current;
	log_verbose("importing unknown segment");
	for (current = sn; current != NULL; current = current->sib) {
		if (!strcmp(current->key, "type") || !strcmp(current->key, "start_extent") ||
		    !strcmp(current->key, "tags") || !strcmp(current->key, "extent_count"))
			continue;
		new = clone_config_node_with_mem(seg->lv->vg->vgmem, current, 0);
		if (!new)
			return_0;
		if (last)
			last->sib = new;
		if (!head)
			head = new;
		last = new;
	}
	seg->segtype_private = head;
	return 1;
}

static int _unknown_text_export(const struct lv_segment *seg, struct formatter *f)
{
	struct config_node *cn = seg->segtype_private;
	return out_config_node(f, cn);
}

#ifdef DEVMAPPER_SUPPORT
static int _unknown_add_target_line(struct dev_manager *dm __attribute__((unused)),
				struct dm_pool *mem __attribute__((unused)),
				struct cmd_context *cmd __attribute__((unused)),
				void **target_state __attribute__((unused)),
				struct lv_segment *seg __attribute__((unused)),
				const struct lv_activate_opts *laopts __attribute__((unused)),
				struct dm_tree_node *node, uint64_t len,
				uint32_t *pvmove_mirror_count __attribute__((unused)))
{
	return dm_tree_node_add_error_target(node, len);
}
#endif

static void _unknown_destroy(struct segment_type *segtype)
{
	dm_free(segtype);
}

static struct segtype_handler _unknown_ops = {
	.name = _unknown_name,
	.text_import = _unknown_text_import,
	.text_export = _unknown_text_export,
#ifdef DEVMAPPER_SUPPORT
	.add_target_line = _unknown_add_target_line,
#endif
	.destroy = _unknown_destroy,
};

struct segment_type *init_unknown_segtype(struct cmd_context *cmd, const char *name)
{
	struct segment_type *segtype = dm_zalloc(sizeof(*segtype));

	if (!segtype)
		return_NULL;

	segtype->cmd = cmd;
	segtype->ops = &_unknown_ops;
	segtype->name = dm_pool_strdup(cmd->mem, name);
	segtype->private = NULL;
	segtype->flags = SEG_UNKNOWN | SEG_VIRTUAL | SEG_CANNOT_BE_ZEROED;

	log_very_verbose("Initialised segtype: %s", segtype->name);

	return segtype;
}


text:
class Profile;

namespace base {
class RefCountedMemory;
}

namespace chrome {
enum class FaviconUrlFormat;
struct ParsedFaviconPath;
}

namespace ui {
class NativeTheme;
}

// FaviconSource is the gateway between network-level chrome:
// requests for favicons and the history backend that serves these.
// Two possible formats are allowed: chrome://favicon, kept only for backwards
// compatibility for extensions, and chrome://favicon2. Formats are described in
// favicon_url_parser.h.
class FaviconSource : public content::URLDataSource {
 public:
  // |type| is the type of icon this FaviconSource will provide.
  explicit FaviconSource(Profile* profile, chrome::FaviconUrlFormat format);

  ~FaviconSource() override;

  // content::URLDataSource implementation.
  std::string GetSource() override;
  void StartDataRequest(
      const GURL& url,
      const content::WebContents::Getter& wc_getter,
      content::URLDataSource::GotDataCallback callback) override;
  std::string GetMimeType(const std::string&) override;
  bool AllowCaching() override;
  bool ShouldReplaceExistingSource() override;
  bool ShouldServiceRequest(const GURL& url,
                            content::BrowserContext* browser_context,
                            int render_process_id) override;

 protected:
  // Exposed for testing.
  virtual ui::NativeTheme* GetNativeTheme();
  virtual base::RefCountedMemory* LoadIconBytes(float scale_factor,
                                                int resource_id);

  Profile* profile_;

 private:
  // Defines the allowed pixel sizes for requested favicons.
  enum IconSize {
    SIZE_16,
    SIZE_32,
    SIZE_64,
    NUM_SIZES
  };

  // Called when favicon data is available from the history backend. If
  // |bitmap_result| is valid, returns it to caller using |callback|. Otherwise
  // will send appropriate default icon for |size_in_dip| and |scale_factor|.
  void OnFaviconDataAvailable(
      content::URLDataSource::GotDataCallback callback,
      const chrome::ParsedFaviconPath& parsed,
      const favicon_base::FaviconRawBitmapResult& bitmap_result);

  // Sends the 16x16 DIP 1x default favicon.
  void SendDefaultResponse(content::URLDataSource::GotDataCallback callback);

  // Sends back default favicon or fallback monogram.
  void SendDefaultResponse(content::URLDataSource::GotDataCallback callback,
                           const chrome::ParsedFaviconPath& parsed);

  // Sends the default favicon.
  void SendDefaultResponse(content::URLDataSource::GotDataCallback callback,
                           int size_in_dip,
                           float scale_factor);

  chrome::FaviconUrlFormat url_format_;

  base::CancelableTaskTracker cancelable_task_tracker_;

  base::WeakPtrFactory<FaviconSource> weak_ptr_factory_{this};

  DISALLOW_COPY_AND_ASSIGN(FaviconSource);
};

#endif  // CHROME_BROWSER_UI_WEBUI_FAVICON_SOURCE_H_


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

    <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
    <title>Zend_Service_DeveloperGarden - Zend Framework Manual</title>

                    Zend_Service_Delicious(日本語)

Zend_Service

                        Programmer's Reference Guide

Zend_Service_Ebay

Zend_Service_DeveloperGarden

Introduction to DeveloperGarden

            Developer Garden is the name of Deutsche Telekom's developer community.
            Developer Garden offers you  access to core services of Deutsche Telekom,
            such as voice connections (Voice Call) or sending text messages (Send SMS)
            via open interfaces (Open <acronym class="acronym">API</acronym>s). You can access the Developer Garden
            services directly via <acronym class="acronym">SOAP</acronym> or <acronym class="acronym">REST</acronym>.

            The family of Zend_Service_DeveloperGarden components provides a
            clean and simple interface to the » Developer Garden APIs and additionally
            offers functionality to improve handling and performance.

                    BaseUserService:
                    Class to manage <acronym class="acronym">API</acronym> quota and user accounting details.

                    IPLocation:
                    Locale the given IP and returns geo coordinates. Works only with IPs allocated
                    in the network of the Deutsche Telekom.

                    LocalSearch:
                    Allows you to search with options nearby or around a given geo coordinate or
                    city.

                    SendSMS: Send a SMS
                    or Flash SMS to a given number.

                    SMSValidation:
                    You can validate a number to use it with SendSMS for also supply a back channel.

                    VoiceCall:
                    Initiates a call between two participants.

                    ConferenceCall:
                    You can configure a whole conference room with participants for an adhoc
                    conference or you can also schedule your conference.

            The backend <acronym class="acronym">SOAP</acronym> <acronym class="acronym">API</acronym> is documented
            » here.

Sign Up for an Account

                Before you can start using the DeveloperGarden <acronym class="acronym">API</acronym>, you first
                have to » sign up for an
                account.

The Environment

                With the DeveloperGarden <acronym class="acronym">API</acronym> you have the possibility to choose
                between 3 different development environments.

                        production: In Production environment there are no
                        usage limitations. You have to pay for calls, sms and other services with
                        costs.

                        sandbox: In the Sandbox mode you can use the same
                        features (with limitations) as in the production without to paying
                        for them. This environment is suitable for testing your prototype.

                        mock: The Mock environment allows you to build your
                        application and have results but you do not initiate any action on the
                        <acronym class="acronym">API</acronym> side. This environment is intended for testing during
                        development.

                For every environment and service, there are some special features (options)
                available for testing. Please look » here for
                details.

Your configuration

                You can pass to all classes an array of configuration values. Possible values are:

                        username: Your DeveloperGarden <acronym class="acronym">API</acronym>
                        username.

                        password: Your DeveloperGarden <acronym class="acronym">API</acronym>
                        password.

                        environment: The environment that you selected.

Example #1 Configuration Example

require_once 'Zend/Service/DeveloperGarden/SendSms.php';

$config = array(

    'username'    => 'yourUsername',

    'password'    => 'yourPassword',

    'environment' => Zend_Service_DeveloperGarden_SendSms::ENV_PRODUCTION,

);

$service = new Zend_Service_DeveloperGarden_SendSms($config);

BaseUserService

            The class can be used to set and get quota values for the services and to fetch
            account details.

            The  getAccountBalance() method fetches an array
            of account id's with the current balance status (credits).

Example #2 Get account balance example

$service = new Zend_Service_DeveloperGarden_BaseUserService($config);

print_r($service->getAccountBalance());

Get quota information

                You can fetch quota informations for a specific service module with the
                provided methods.

Example #3 Get quota information example

$service = new Zend_Service_DeveloperGarden_BaseUserService($config);

$result = $service->getSmsQuotaInformation(

    Zend_Service_DeveloperGarden_BaseUserService::ENV_PRODUCTION

);

echo 'Sms Quota:<br />';

echo 'Max Quota: ', $result->getMaxQuota(), '<br />';

echo 'Max User Quota: ', $result->getMaxUserQuota(), '<br />';

echo 'Quota Level: ', $result->getQuotaLevel(), '<br />';

                You get a result object that contains all the information
                you need, optional you can pass to the  QuotaInformation
                method the environment constant to fetch the quota for the specific environment.

                Here a list of all  getQuotaInformation methods:

                         getConfernceCallQuotaInformation()

                         getIPLocationQuotaInformation()

                         getLocalSearchQuotaInformation()

                         getSmsQuotaInformation()

                         getVoiceCallQuotaInformation()

Change quota information

                To change the current quota use one of the  changeQuotaPool
                methods. First parameter is the new pool value and the second one is the
                environment.

Example #4 Change quota information example

$service = new Zend_Service_DeveloperGarden_BaseUserService($config);

$result = $service->changeSmsQuotaPool(

    1000,

    Zend_Service_DeveloperGarden_BaseUserService::ENV_PRODUCTION

);

if (!$result->hasError()) {

    echo 'updated Quota Pool';

}

                Here a list of all  changeQuotaPool methods:

                         changeConferenceCallQuotaPool()

                         changeIPLocationQuotaPool()

                         changeLocalSearchQuotaPool()

                         changeSmsQuotaPool()

                         changeVoiceCallQuotaPool()

IP Location

            This service allows you to retrieve location information for a given IP address.

            There are some limitations:

The IP address must be in the T-Home network

Just the next big city will be resolved

IPv6 is not supported yet

Example #5 Locate a given IP

$service = new Zend_Service_DeveloperGarden_IpLocation($config);

$service->setEnvironment(

    Zend_Service_DeveloperGarden_IpLocation::ENV_MOCK

);

$ip = new Zend_Service_DeveloperGarden_IpLocation_IpAddress('127.0.0.1');

print_r($service->locateIp($ip));

Local Search

            The Local Search service provides the location based search machine » suchen.de via web service interface. For
            more details, refer to » the
                documentation.

Example #6 Locate a Restaurant

$service = new Zend_Service_DeveloperGarden_LocalSearch($config);

$search  = new Zend_Service_DeveloperGarden_LocalSearch_SearchParameters();

/**

 * @see http://www.developergarden.com/static/docu/en/ch04s02s06s04.html

 */

$search->setWhat('pizza')

       ->setWhere('jena');

print_r($service->localSearch($search));

Send SMS

            The Send SMS service is used to send normal and Flash SMS to any number.

            The following restrictions apply to the use of the SMS service:

                    An SMS or Flash SMS in the production environment must not be longer than
                    765 characters and must not be sent to more than 10 recipients.

                    An SMS or Flash SMS in the sandbox environment is shortened and enhanced by a
                    note from the DeveloperGarden. The maximum length of the message is 160
                    characters.

                    In the sandbox environment, a maximum of 10 SMS can be sent per day.

                    The following characters are counted twice:
                    | ^ € { } [ ] ~ \ LF (line break)

                    If a SMS or Flash SMS is longer than 160 characters, one message is charged for
                    each 153 characters (quota and credit).

                    Delivery cannot be guaranteed for SMS or Flash SMS to landline numbers.

                    The sender can be a maximum of 11 characters. Permitted characters are
                    letters and numbers.

                    The specification of a phone number as the sender is only permitted if the phone
                    number has been validated. (See: SMS Validation)

Example #7 Sending an SMS

$service = new Zend_Service_DeveloperGarden_SendSms($config);

$sms = $service->createSms(

    '+49-172-123456; +49-177-789012',

    'your test message',

    'yourname'

);

print_r($service->send($sms));

SMS Validation

            The SMS Validation service allows the validation of physical phone number to be used
            as the sender of an SMS.

            First, call  setValidationKeyword() to receive an SMS
            with a keyword.

            After you get your keyword, you have to use the  validate() to
            validate your number with the keyword against the service.

            With the method  getValidatedNumbers(), you will get a list
            of all already validated numbers and the status of each.

Example #8 Request validation keyword

$service = new Zend_Service_DeveloperGarden_SmsValidation($config);

print_r($service->sendValidationKeyword('+49-172-123456'));

Example #9 Validate a number with a keyword

$service = new Zend_Service_DeveloperGarden_SmsValidation($config);

print_r($service->validate('TheKeyWord', '+49-172-123456'));

            To invalidate a validated number, call the method  inValidate().

Voice Call

            The Voice Call service can be used to set up a voice connection between two telephone
            connections. For specific details please read the » API
                Documentation.

            Normally the Service works as followed:

                    Call the first participant.

                    If the connection is successful, call the second participant.

                    If second participant connects succesfully, both participants are connected.

                    The call is open until one of the participants hangs up or the expire mechanism
                    intercepts.

Example #10 Call two numbers

$service = new Zend_Service_DeveloperGarden_VoiceCall($config);

$aNumber = '+49-30-000001';

$bNumber = '+49-30-000002';

$expiration  = 30;  // seconds

$maxDuration = 300; // 5 mins

$newCall = $service->newCall($aNumber, $bNumber, $expiration, $maxDuration);

echo $newCall->getSessionId();

            If the call is initiated, you can ask the result object for the session ID and
            use this session ID for an additional call to the  callStatus
            or  tearDownCall() methods. The second parameter on the
             callStatus() method call extends the expiration for this call.

Example #11 Call two numbers, ask for status, and cancel

$service = new Zend_Service_DeveloperGarden_VoiceCall($config);

$aNumber = '+49-30-000001';

$bNumber = '+49-30-000002';

$expiration  = 30; // seconds

$maxDuration = 300; // 5 mins

$newCall = $service->newCall($aNumber, $bNumber, $expiration, $maxDuration);

$sessionId = $newCall->getSessionId();

$service->callStatus($sessionId, true); // extend the call

sleep(10); // sleep 10s and then tearDown

$service->tearDownCall($sessionId);

ConferenceCall

            Conference Call allows you to setup and start a phone conference.

            The following features are available:

                    Conferences with an immediate start

                    Conferences with a defined start date

                    Recurring conference series

                    Adding, removing, and muting of participants from a conference

                    Templates for conferences

            Here is a list of currently implemented <acronym class="acronym">API</acronym> methods:

                     createConference() creates a new conference

                     updateConference() updates an existing conference

                     commitConference() saves the conference, and, if no
                    date is configured, immediately starts the conference

                     removeConference() removes a conference

                     getConferenceList() returns a list of all configured
                    conferences

                     getConferenceStatus() displays information for an
                    existing conference

                     getParticipantStatus() displays status information
                    about a conference participant

                     newParticipant() creates a new participant

                     addParticipant() adds a participant to a conference

                     updateParticipant() updates a participant,
                    usually to mute or redial the participant

                     removeParticipant() removes a participant from a
                    conference

                     getRunningConference() requests the running instance of
                    a planned conference

                     createConferenceTemplate() creates a new conference
                    template

                     getConferenceTemplate() requests an existing conference
                    template

                     updateConferenceTemplate() updates existing conference
                    template details

                     removeConferenceTemplate() removes a conference
                    template

                     getConferenceTemplateList() requests all conference
                    templates of an owner

                     addConferenceTemplateParticipant() adds a conference
                    participant to conference template

                     getConferenceTemplateParticipant() displays details of
                    a participant of a conference template

                     updateConferenceTemplateParticipant() updates
                    participant details within a conference template

                     removeConferenceTemplateParticipant() removes
                    a participant from a conference template

Example #12 Ad-Hoc conference

$client = new Zend_Service_DeveloperGarden_ConferenceCall($config);

$conferenceDetails =

    new Zend_Service_DeveloperGarden_ConferenceCall_ConferenceDetail(

        'Zend-Conference',                    // name for the conference

        'this is my private zend conference', // description

        60                                    // duration in seconds

    );

$conference = $client->createConference('MyName', $conferenceDetails);

$part1 = new Zend_Service_DeveloperGarden_ConferenceCall_ParticipantDetail(

    'Jon',

    'Doe',

    '+49-123-4321',

    'your.name@example.com',

    true

);

$client->newParticipant($conference->getConferenceId(), $part1);

// add a second, third ... participant

$client->commitConference($conference->getConferenceId());

Performance and Caching

            You can setup various caching options to improve the performance for resolving WSDL and
            authentication tokens.

            First of all, you can setup the internal SoapClient (PHP) caching values.

Example #13 WSDL cache options

Zend_Service_DeveloperGarden_SecurityTokenServer_Cache::setWsdlCache(

    [PHP CONSTANT]

);

            The <tt>[PHP CONSTANT]</tt> can be one of the following values:

                    <tt>WSDL_CACHE_DISC</tt>: enabled disc caching

                    <tt>WSDL_CACHE_MEMORY</tt>: enabled memory caching

                    <tt>WSDL_CACHE_BOTH</tt>: enabled disc and memory caching

                    <tt>WSDL_CACHE_NONE</tt>: disabled both caching

            If you also want to cache the result for calls to the SecuritTokenServer
            you can setup a Zend_Cache instance and pass it to the
             setCache().

Example #14 SecurityTokenServer cache option

$cache = Zend_Cache::factory('Core', ...);

Zend_Service_DeveloperGarden_SecurityTokenServer_Cache::setCache($cache);

                    Zend_Service_Delicious(日本語)

Zend_Service

                        Programmer's Reference Guide

Zend_Service_Ebay

Programmer's Reference Guide

Programmer's Reference Guide

Zend Framework Reference

Zend_Service

導入

Zend_Service_Akismet(日本語)

Zend_Service_Amazon(日本語)

Zend_Service_Amazon_Ec2(日本語)

Zend_Service_Amazon_Ec2: Instances

Zend_Service_Amazon_Ec2: Windows Instances

Zend_Service_Amazon_Ec2: Reserved Instances

Zend_Service_Amazon_Ec2: CloudWatch Monitoring

Zend_Service_Amazon_Ec2: Amazon Machine Images (AMI)

Zend_Service_Amazon_Ec2: Elastic Block Storage (EBS)

Zend_Service_Amazon_Ec2: Elastic IP Addresses

Zend_Service_Amazon_Ec2: Keypairs(日本語)

Zend_Service_Amazon_Ec2:リージョンおよび利用可能ゾーン

Zend_Service_Amazon_Ec2: Security Groups

Zend_Service_Amazon_S3

Zend_Service_Amazon_Sqs

Zend_Service_Audioscrobbler(日本語)

Zend_Service_Delicious(日本語)

Zend_Service_DeveloperGarden

Zend_Service_Ebay

Zend_Service_Ebay_Finding

Zend_Service_Flickr(日本語)

Zend_Service_LiveDocx

Zend_Service_Nirvanix(日本語)

Zend_Service_ReCaptcha(日本語)

Zend_Service_ShortUrl

Zend_Service_Simpy(日本語)

Zend_Service_SlideShare(日本語)

Zend_Service_StrikeIron(日本語)

Zend_Service_StrikeIron: バンドルされているサービス

Zend_Service_StrikeIron: 応用編

Zend_Service_Technorati(日本語)

Zend_Service_Twitter

Zend_Service_WindowsAzure

Zend_Service_WindowsAzure_Storage_Blob

Zend_Service_WindowsAzure_Diagnostics_Manager

Zend_Service_WindowsAzure_Storage_Queue

Zend_Service_WindowsAzure_Storage_Table

Zend_Service_Yahoo(日本語)


text:
import React, { PropTypes, Component } from 'react';

import { Link } from 'react-router';

import Icon from './../atoms/Icon';

class MenuListItem extends Component {

    render() {
        return (

        <Link to={this.props.href}>
          {
            this.props.icon &&
            <Icon>{this.props.icon}</Icon>
          }
          {this.props.label}
        </Link>

    );
    }

}

MenuListItem.propTypes = {
    href: PropTypes.string,
    label: PropTypes.string,
    icon: PropTypes.string
};

export default MenuListItem;


text:
@import url(https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.6.3/css/font-awesome.css);

.app-pic {
  width: 100%;
  height: auto;
  margin: 10% 0% 10% 0%;
  border-color: #4c6085;
  border-width: .3vw;
  border-style: solid;
}

/*
.navbar-color {
  background-color: #4c6085;
  border: none !important;
  color: white !important;
}
.navbar-nav > li > a {
  color: white !important;
}
.navbar-nav > li > a:hover {
  background-color: #d6d6d6 !important;
  color: #4C6085 !important;
}

.navbar-default .navbar-nav .open .dropdown-menu > .active > a,
.navbar-default .navbar-nav .open .dropdown-menu > .active > a:hover,
.navbar-default .navbar-nav .open .dropdown-menu > .active > a:focus {
  color: #4c6085;
  background-color: #d6d6d6;
}
.navbar-default .navbar-nav > .active > a,
.navbar-default .navbar-nav > .active > a:hover,
.navbar-default .navbar-nav > .active > a:focus {
  color: #4c6085;
  background-color: #d6d6d6;
}
*/

input, textarea {
  border: none;
  border-bottom: 2px solid black;
  background-color: #D9D9D9 !important;
}

.navbar-brand {
  color: white !important;
  font-size: 2em !important;
}
.navbar-toggle > .icon-bar{
  background-color: white !important;
}

p, a, h2, .form-item, textarea, .btn {

}

body {

  font-family: 'Roboto Condensed', sans-serif;
  padding-top: 70px;

}

.social-container {
  margin: 10% 0% 10% 0%;

}

.fa {
  color: white;
  font-size: 1.5em;

}
.social-btn {
  margin-right: 1vw;
  width: 10%;
  background-color: #79aea3;
}
.submit-btn {
  background-color: #79aea3;
  color: white;
}
.submit-btn:hover {
  color: #4C6085 !important;
  background-color: #d6d6d6 !important;
}
a.btn-twitter:hover {
  background-color:#00aced !important;
}
a.btn-codepen:hover {
  background-color: black !important;
}
a.btn-linkedin:hover {
  background-color: #0077B5 !important;
}
a.btn-github:hover {
  background-color: black !important;
}
a.btn-email:hover {
  background-color: #d34836 !important;
}
#contactForm {
  margin: 10% 0% 0% 0%;
}

.intro-sect {
  margin: 10px 10px 10px 10px;
}
.intro-text {
  margin: 1% 0% 0% 0%;
}
.vertical-align {
    display: flex;
    align-items: center;
}

.pic-me {
  height: auto;
  width: 10vw;

}

.contact-sect {
  padding: 1% 0% 2% 0%;
  background-color: black;
  -webkit-background-size: cover;
  -moz-background-size: cover;
  background-size: cover;
  -o-background-size: cover;
}

.form-item {
  border: 0px;

}


text:
package sds.classfile.attribute

import sds.classfile.{ClassfileStream => Stream}
import sds.classfile.constant_pool.{ConstantInfo => CInfo}
import sds.classfile.attribute.AnnotationGenerator.generate

class RuntimeParameterAnnotations(data: Stream, pool: Array[CInfo], private val name: String) extends AttributeInfo {
    val annotations: Array[Array[String]] = (0 until data.byte).map((x: Int) => {
        (0 until data.short).map((y: Int) => generate(data, pool)).toArray
    }).toArray
}


text:
package org.agorava.linkedin.model;

import org.agorava.api.function.IntIdentifiable;
import org.agorava.api.function.Nameable;
import org.agorava.linkedin.model.Post.PostCategory;

import java.io.Serializable;
import java.util.List;

/**
 * Model class representing a group on LinkedIn
 *
 * @author Robert Drysdale
 * @author Werner Keil
 * @author Antoine Sabot-Durand
 */
public class Group implements IntIdentifiable, Nameable {

    private static final long serialVersionUID = 1L;

    private Boolean allowMemberInvites;
    private GroupCategory category;
    private List<GroupCount> countsByCategory;
    private String description;
    private final int id;
    private Boolean isOpenToNonMembers;
    private String largeLogoUrl;
    private String locale;
    private final String name;
    private GroupPosts posts;
    private GroupRelation relationToViewer;
    private String shortDescription;
    private String siteGroupUrl;
    private String smallLogoUrl;
    private String websiteUrl;

    public Group(Integer id, String name) {
        this.id = id;
        this.name = name;
    }

    public Boolean getAllowMemberInvites() {
        return allowMemberInvites;
    }

    public GroupCategory getCategory() {
        return category;
    }

    public List<GroupCount> getCountsByCategory() {
        return countsByCategory;
    }

    public String getDescription() {
        return description;
    }

    public int getId() {
        return id;
    }

    public Boolean isOpenToNonMembers() {
        return isOpenToNonMembers;
    }

    public String getLargeLogoUrl() {
        return largeLogoUrl;
    }

    public String getLocale() {
        return locale;
    }

    public String getName() {
        return name;
    }

    public GroupPosts getPosts() {
        return posts;
    }

    public GroupRelation getRelationToViewer() {
        return relationToViewer;
    }

    public String getShortDescription() {
        return shortDescription;
    }

    public String getSiteGroupUrl() {
        return siteGroupUrl;
    }

    public String getSmallLogoUrl() {
        return smallLogoUrl;
    }

    public String getWebsiteUrl() {
        return websiteUrl;
    }

    public static class GroupCount implements Serializable {

        private static final long serialVersionUID = 1L;
        private final PostCategory category;
        private final Integer count;

        public GroupCount(PostCategory category, Integer count) {
            this.category = category;
            this.count = count;
        }

        public PostCategory getCategory() {
            return category;
        }

        public Integer getCount() {
            return count;
        }
    }

    public static class GroupPosts extends SearchResult {
        private static final long serialVersionUID = 1L;

        public GroupPosts(int count, int start, int total) {
            super(count, start, total);
        }

        private List<Post> posts;

        public List<Post> getPosts() {
            return posts;
        }
    }

    public static class GroupRelation implements Serializable {
        private static final long serialVersionUID = 1L;

        private final List<GroupAvailableAction> availableActions;
        private final MembershipState membershipState;

        public GroupRelation(List<GroupAvailableAction> availableActions, MembershipState membershipState) {
            this.availableActions = availableActions;
            this.membershipState = membershipState;
        }

        public List<GroupAvailableAction> getAvailableActions() {
            return availableActions;
        }

        public MembershipState getMembershipState() {
            return membershipState;
        }
    }

    public static enum GroupCategory {
        ALUMNI, CORPORATE, CONFERENCE, NETWORK, PHILANTHROPIC, PROFESSIONAL, OTHER
    }

    public static enum MembershipState {
        BLOCKED, NON_MEMBER, AWAITING_CONFIRMATION, AWAITING_PARENT_GROUP_CONFIRMATION,
        MEMBER, MODERATOR, MANAGER, OWNER
    }

    public static enum GroupAvailableAction {
        ADD_POST, LEAVE, VIEW_POSTS
    }
}


text:
define(['iweb/CoreModule', "nics/modules/UserProfileModule", './FmagReportView', './FmagFormView','./FmagFormModel'],

	function(Core, UserProfile, FmagReportView, FmagFormView , FmagFormModel ){

		Ext.define('modules.report-fmag.FmagFormController', {
			extend : 'Ext.app.ViewController',

			alias: 'controller.fmagformcontroller',

			init : function(args) {

				this.mediator = Core.Mediator.getInstance();

			},

			 buildReport: function(data, reportType){

		    	var doc = null;

				doc = "
NICS - " + data.incidentName;
				doc += "

" + this.formatDate(data.requestDate) + "

";
				doc += "Report Type: " + data.reportType + "
";
				doc += "
";
				doc += "
Agency Making Request*: " + data.agencyRequest + "
";
				doc += "
Date/Time of Request*: " + this.formatDate(data.requestDate) + "
";
				doc += "
Fire Incident Name*: " + data.incidentName + "
";
				doc += "
Inc. Number*: " + data.incidentId + "
";
				doc += "
City/County*: " + data.cityCounty + "
";
				doc += "
Acreage*: " + data.acreage + "
";
				doc += "
Cause*: " + data.cause + "
";
				doc += "
Date/Time Fire Started*: " + this.formatDate(data.fireDate) + "
";
				doc += "
IC*: " + data.ic + "
";
				doc += "
Agency Making Request*: " + data.agencyRequest + "
";
				doc += "
Contact Name*: " + data.contactName + "
";
				doc += "
Phone*: " + data.phone + "

";

				doc += "
FACTORS";
				doc += "
Community Threatened*: " + data.threat + "
";
				doc += "
Population*: " + data.population + "
";

				doc += "
Persons Evacuated";
				doc += "
Mandatory*: " + data.mandatory + "
";
				doc += "
Volunteer*: " + data.volunteer + "

";

				doc += "
Shelters";
				doc += "
Shelters Open? (Y/N)*: " + data.sheltersOpen + "
";
				doc += "
How Many?*: " + data.sheltersCount + "
";
				doc += "
Where?*: " + data.sheltersLocal + "

";

				doc += "
Structures";
				doc += "
# of Structures Threatened*: " + data.threatStructs + "
";
				doc += "
Residential*: " + data.resStructs + "
";
				doc += "
Business*: " + data.busStructs + "
";
				doc += "
Fire Proximity to Structures*: " + data.fireProxStructs + "
";
				doc += "
Structures Vacation or Residential*: " + data.vacaResStructs + "
";
				doc += "
Subdivision or Rural*: " + data.subRuralStructs + "
";
				doc += "
Natural/Man Made Barriers*: " + data.natManBarriers + "
";
				doc += "
Infrastructure/Facilities/Equipment/Resources Threatened*: " + data.infFacEquResThreat + "

";

				doc += "
Resources Committed In %";
				doc += "
% of all Engine types*: " + data.percEngTypes + "
";
				doc += "
Local %*: " + data.percLocal + "
";
				doc += "
Operational Area %*: " + data.percOpArea + "
";
				doc += "
Region to Region Ordering %*: " + data.percRegOrder + "

";

				doc += "
County EOC Activated (Y/N)*: " + data.countyEocActive + "
";
				doc += "
Full*: " + data.full + "
";
				doc += "
Limited*: " + data.limited + "
";
				doc += "
Fual & Terrain Type*: " + data.fuelTerType + "
";
				doc += "
Fire Containment %*: " + data.percFireCont + "
";
				doc += "
Other critical considerations*: " + data.criticalCon + "

";

				doc += "
PROGNOSIS";
				doc += "
Weather";
				doc += "
Temp./Relative Humidity*: " + data.tempRelHum + "

";

				doc += "
Fire Behavior";
				doc += "
Fire Behavior Current*: " + data.fireBehCurrent + "
";
				doc += "
Fire Behavior Growth/Behavior Potential (next burning period)";
				doc += "
LRA*: " + data.lra + "
";
				doc += "
SRA*: " + data.sra + "
";
				doc += "
FRA*: " + data.fra + "

";

				doc += "
Current 209*: " + data.current209 + "
";
				doc += "
Incident Map*: " + data.incidentMap + "
";
				doc += "
Weather*: " + data.weather + "
";
				doc += "
Other Docs*: " + data.otherDocs + "
";

		    	console.log(doc);
		    	Core.EventManager.fireEvent("PrintFmagReport",doc);

			},

			clearForm: function () {

				 var username  = UserProfile.getFirstName() + " " + UserProfile.getLastName();
				 this.view.getForm().getFields().each (function (field) {
						 field.setValue("");
			     });

			},

		    setFormReadOnly: function () {
		    	this.view.getForm().getFields().each (function (field) {
		    		field.setReadOnly(true);
		    	});
		    	this.view.lookupReference('submitButton').hide();
		    	this.view.lookupReference('resetButton').hide();
		    	this.view.lookupReference('cancelButton').hide();
		    },
		    enableForm: function () {
		    	this.view.getForm().getFields().each (function (field) {
		    		field.setReadOnly(false);
		    	});
		    	this.view.lookupReference('submitButton').show();
		    	this.view.lookupReference('resetButton').show();
		    },

	    	submitForm: function(){
	    		var form = {};
	    		var message = {};
	    		var report= {}

	    		var time = Core.Util.formatDateToString(new Date());

	    		message.datecreated = time;

	    		var formView = this.view.viewModel;

	    		if (typeof(formView.data.simplifiedEmail) == "undefined" )  {formView.data.simplifiedEmail = true;}

	    		if (formView.get('report') === null){
	    			//create the report from the data
	    		   for (item in formView.data){
	    			   //Don't capture the buttons, or the incident name and id in the report
	    			   var buttonRE = /button$/i;
	    			  // var isButton = buttonRE.test(item);
	    			   if (item != 'incidentId' && item != 'incidentName' && !(buttonRE.test(item)) )
	    					report[item] = formView.data[item];
	    		  }
	    		   message.report = report;

	    		}else {
	    			//report has already been created
	    			message.report = formView.get('report');

	    		}

	    		//Populate form properties
	    		form.incidentid = formView.data.incidentId;
	    		form.incidentname = formView.data.incidentName;
	    		form.formtypeid = formView.data.formTypeId; //this is always a ABC
	    		form.usersessionid = UserProfile.getUserSessionId();
	    		form.distributed = false;
	    		form.message = JSON.stringify(message);

				var url = Ext.String.format('{0}/reports/{1}/{2}',
						Core.Config.getProperty(UserProfile.REST_ENDPOINT),
						formView.data.incidentId, 'ABC');

				var topic = Ext.String.format("iweb.NICS.incident.{0}.report.{1}.#", formView.data.incidentId, 'ABC');

				this.mediator.sendPostMessage(url, topic, form);
				this.setFormReadOnly();
				this.newTopic = Ext.String.format(
						"iweb.NICS.incident.{0}.report.{1}.new", form.incidentid,
						'ABC');
				Core.EventManager.fireEvent(this.newTopic);

	    	},

	    	cancelForm: function(){
	    		this.setFormReadOnly();
	    	},

	    	formatDate: function(date)
	        {
	            var str = (date.getMonth() + 1) + "-"
	            + date.getDate() + "-"
	            + date.getFullYear() + " "
	            + date.getHours() + ':'
	            + date.getMinutes() +
	            ':' + date.getSeconds();

	            return str;
	        }

		});
});


text:
// Copyright 2015 The Project Buendia Authors
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not
// use this file except in compliance with the License.  You may obtain a copy
// of the License at: http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software distrib-
// uted under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
// OR CONDITIONS OF ANY KIND, either express or implied.  See the License for
// specific language governing permissions and limitations under the License.

package org.projectbuendia.client.utils;

import android.content.Context;

import org.projectbuendia.client.R;

/** Provides helper methods for displaying patient counts with support for internationalization. */
public class PatientCountDisplay {
    /**
     * Constructs a String from a prefix String and patient count.
     * @param context      the Application or Activity context
     * @param patientCount the number of patients
     * @param prefix       a String preceding the patient count (for example, the name of a location)
     * @return a String containing the prefix string and patient count in a displayable format
     */
    public static String getPatientCountTitle(Context context, long patientCount, String prefix) {
        // If no patient count is available, only show the location name.
        if (patientCount == -1) {
            return prefix;
        }

        return context.getResources().getString(
            R.string.string_with_paren, prefix, getPatientCountSubtitle(context, patientCount));
    }

    public static String getPatientCountSubtitle(Context context, long patientCount) {
        return getPatientCountSubtitle(context, patientCount, false);
    }

    public static String getPatientCountSubtitle(
        Context context, long patientCount, boolean usePresent) {
        int resource = resourceForPatientCount(patientCount, usePresent);
        return context.getResources().getString(resource, patientCount);
    }

    // TODO/i18n: Switch to built in support for plurals in Android.
    private static int resourceForPatientCount(long patientCount, boolean usePresentResource) {
        int resource;
        if (patientCount < 1) {
            if (usePresentResource) {
                resource = R.string.no_present_patients;
            } else {
                resource = R.string.no_patients;
            }
        } else if (patientCount == 1) {
            if (usePresentResource) {
                resource = R.string.one_present_patient;
            } else {
                resource = R.string.one_patient;
            }
        } else {
            if (usePresentResource) {
                resource = R.string.n_present_patients;
            } else {
                resource = R.string.n_patients;
            }
        }
        return resource;
    }
}


text:
"""
borrowed from jython
https://bitbucket.org/jython/jython/raw/28a66ba038620292520470a0bb4dc9bb8ac2e403/Lib/select.py
"""

#import java.nio.channels.SelectableChannel
#import java.nio.channels.SelectionKey
#import java.nio.channels.Selector
#from java.nio.channels.SelectionKey import OP_ACCEPT, OP_CONNECT, OP_WRITE, OP_READ

import errno
import os
import queue
import socket

class error(Exception): pass

ALL = None

_exception_map = {

# (<javaexception>, <circumstance>) : lambda: <code that raises the python equivalent>

#(java.nio.channels.ClosedChannelException, ALL) : error(errno.ENOTCONN, 'Socket is not connected'),
#(java.nio.channels.CancelledKeyException, ALL) : error(errno.ENOTCONN, 'Socket is not connected'),
#(java.nio.channels.IllegalBlockingModeException, ALL) : error(errno.ESOCKISBLOCKING, 'socket must be in non-blocking mode'),
}

def _map_exception(exc, circumstance=ALL):
    try:
        mapped_exception = _exception_map[(exc.__class__, circumstance)]
        mapped_exception.java_exception = exc
        return mapped_exception
    except KeyError:
        return error(-1, 'Unmapped java exception: <%s:%s>' % (exc.toString(), circumstance))

POLLIN   = 1
POLLOUT  = 2

# The following event types are completely ignored on jython
# Java does not support them, AFAICT
# They are declared only to support code compatibility with cpython

POLLPRI  = 4
POLLERR  = 8
POLLHUP  = 16
POLLNVAL = 32

def _getselectable(selectable_object):
    try:
        channel = selectable_object.getchannel()
    except:
        try:
            channel = selectable_object.fileno().getChannel()
        except:
            raise TypeError("Object '%s' is not watchable" % selectable_object,
                            errno.ENOTSOCK)

    if channel and not isinstance(channel, java.nio.channels.SelectableChannel):
        raise TypeError("Object '%s' is not watchable" % selectable_object,
                        errno.ENOTSOCK)
    return channel

class poll:

    def __init__(self):
        self.selector = java.nio.channels.Selector.open()
        self.chanmap = {}
        self.unconnected_sockets = []

    def _register_channel(self, socket_object, channel, mask):
        jmask = 0
        if mask & POLLIN:
            # Note that OP_READ is NOT a valid event on server socket channels.
            if channel.validOps() & OP_ACCEPT:
                jmask = OP_ACCEPT
            else:
                jmask = OP_READ
        if mask & POLLOUT:
            if channel.validOps() & OP_WRITE:
                jmask |= OP_WRITE
            if channel.validOps() & OP_CONNECT:
                jmask |= OP_CONNECT
        selectionkey = channel.register(self.selector, jmask)
        self.chanmap[channel] = (socket_object, selectionkey)

    def _check_unconnected_sockets(self):
        temp_list = []
        for socket_object, mask in self.unconnected_sockets:
            channel = _getselectable(socket_object)
            if channel is not None:
                self._register_channel(socket_object, channel, mask)
            else:
                temp_list.append( (socket_object, mask) )
        self.unconnected_sockets = temp_list

    def register(self, socket_object, mask = POLLIN|POLLOUT|POLLPRI):
        try:
            channel = _getselectable(socket_object)
            if channel is None:
                # The socket is not yet connected, and thus has no channel
                # Add it to a pending list, and return
                self.unconnected_sockets.append( (socket_object, mask) )
                return
            self._register_channel(socket_object, channel, mask)
        except BaseException:
        #except java.lang.Exception, jlx:
            raise _map_exception(jlx)

    def unregister(self, socket_object):
        try:
            channel = _getselectable(socket_object)
            self.chanmap[channel][1].cancel()
            del self.chanmap[channel]
        except BaseException:
        #except java.lang.Exception, jlx:
            raise _map_exception(jlx)

    def _dopoll(self, timeout):
        if timeout is None or timeout < 0:
            self.selector.select()
        else:
            try:
                timeout = int(timeout)
                if not timeout:
                    self.selector.selectNow()
                else:
                    # No multiplication required: both cpython and java use millisecond timeouts
                    self.selector.select(timeout)
            except ValueError as vx:
                raise error("poll timeout must be a number of milliseconds or None", errno.EINVAL)
        # The returned selectedKeys cannot be used from multiple threads!
        return self.selector.selectedKeys()

    def poll(self, timeout=None):
        try:
            self._check_unconnected_sockets()
            selectedkeys = self._dopoll(timeout)
            results = []
            for k in selectedkeys.iterator():
                jmask = k.readyOps()
                pymask = 0
                if jmask & OP_READ: pymask |= POLLIN
                if jmask & OP_WRITE: pymask |= POLLOUT
                if jmask & OP_ACCEPT: pymask |= POLLIN
                if jmask & OP_CONNECT: pymask |= POLLOUT
                # Now return the original userobject, and the return event mask
                results.append( (self.chanmap[k.channel()][0], pymask) )
            return results
        except BaseException:
        #except java.lang.Exception, jlx:
            raise _map_exception(jlx)

    def _deregister_all(self):
        try:
            for k in self.selector.keys():
                k.cancel()
            # Keys are not actually removed from the selector until the next select operation.
            self.selector.selectNow()
        except BaseException:
        #except java.lang.Exception, jlx:
            raise _map_exception(jlx)

    def close(self):
        try:
            self._deregister_all()
            self.selector.close()
        except BaseException:
        #except java.lang.Exception, jlx:
            raise _map_exception(jlx)

def _calcselecttimeoutvalue(value):
    if value is None:
        return None
    try:
        floatvalue = float(value)
    except Exception as x:
        raise TypeError("Select timeout value must be a number or None")
    if value < 0:
        raise error("Select timeout value cannot be negative", errno.EINVAL)
    if floatvalue < 0.000001:
        return 0
    return int(floatvalue * 1000) # Convert to milliseconds

# This cache for poll objects is required because of a bug in java on MS Windows
# http://bugs.jython.org/issue1291

class poll_object_cache:

    def __init__(self):
        self.is_windows = os.name == 'nt'
        if self.is_windows:
            self.poll_object_queue = Queue.Queue()
        import atexit
        atexit.register(self.finalize)

    def get_poll_object(self):
        if not self.is_windows:
            return poll()
        try:
            return self.poll_object_queue.get(False)
        except Queue.Empty:
            return poll()

    def release_poll_object(self, pobj):
        if self.is_windows:
            pobj._deregister_all()
            self.poll_object_queue.put(pobj)
        else:
            pobj.close()

    def finalize(self):
        if self.is_windows:
            while True:
                try:
                    p = self.poll_object_queue.get(False)
                    p.close()
                except Queue.Empty:
                    return

_poll_object_cache = poll_object_cache()

def native_select(read_fd_list, write_fd_list, outofband_fd_list, timeout=None):
    timeout = _calcselecttimeoutvalue(timeout)
    # First create a poll object to do the actual watching.
    pobj = _poll_object_cache.get_poll_object()
    try:
        registered_for_read = {}
        # Check the read list
        for fd in read_fd_list:
            pobj.register(fd, POLLIN)
            registered_for_read[fd] = 1
        # And now the write list
        for fd in write_fd_list:
            if fd in registered_for_read:
                # registering a second time overwrites the first
                pobj.register(fd, POLLIN|POLLOUT)
            else:
                pobj.register(fd, POLLOUT)
        results = pobj.poll(timeout)
        # Now start preparing the results
        read_ready_list, write_ready_list, oob_ready_list = [], [], []
        for fd, mask in results:
            if mask & POLLIN:
                read_ready_list.append(fd)
            if mask & POLLOUT:
                write_ready_list.append(fd)
        return read_ready_list, write_ready_list, oob_ready_list
    finally:
        _poll_object_cache.release_poll_object(pobj)

select = native_select

def cpython_compatible_select(read_fd_list, write_fd_list, outofband_fd_list, timeout=None):
    # First turn all sockets to non-blocking
    # keeping track of which ones have changed
    modified_channels = []
    try:
        for socket_list in [read_fd_list, write_fd_list, outofband_fd_list]:
            for s in socket_list:
                channel = _getselectable(s)
                if channel.isBlocking():
                    modified_channels.append(channel)
                    channel.configureBlocking(0)
        return native_select(read_fd_list, write_fd_list, outofband_fd_list, timeout)
    finally:
        for channel in modified_channels:
            channel.configureBlocking(1)


text:
angular.module('app')
  .config(() => {
    // Initialize Firebase
    var config = {
      apiKey: "AIzaSyA3jd-g2KqgxMblPKSqQsIIhbT-c762-YE",
      authDomain: "codename-mercury.firebaseapp.com",
      databaseURL: "https://codename-mercury.firebaseio.com",
      storageBucket: "",
    };
    firebase.initializeApp(config);
  })
  .constant('BASE_API', 'https://codename-mercury.firebaseio.com')


text:
import Content from './content';
import Header from './header';

export default {
  Content,
  Header
};


text:
package de.artcom.hsm;

import java.util.Map;

public interface EventHandler {

    public void handleEvent(String event);
    public void handleEvent(String event, Map<String, Object> payload);

}


text:
<?php

/**
 * Autoload
 *
 * Autoload for the PHP Skeleton App.
 *
 * @author      Goran Halusa <gor@webcraftr.com>
 * @since       0.1.0
 */

  session_start();
  $final_global_template_vars = array(
    "is_dev" => false
  );
  if(!empty($_SERVER["IS_DEV"]) && $_SERVER["IS_DEV"] == "true"){
    $final_global_template_vars["is_dev"] = true;
    error_reporting(E_ALL);
  }
  ini_set('session.cookie_httponly',1);

  require_once $_SERVER["PATH_TO_VENDOR"] . 'slim/slim/Slim/Slim.php';
  \Slim\Slim::registerAutoloader();
  require_once $_SERVER["PATH_TO_VENDOR"] . 'slim/views/Twig.php';
  require_once $_SERVER["PATH_TO_VENDOR"] . 'default/functions/functions.php';
  require_once $_SERVER["PATH_TO_VENDOR"] . 'default/models/utility.php';

  // Added due to PHP errors - by Gor, gor@webcraftr.com, 2013-07-16
  // "PHP Strict Standards:  Non-static method phpskeleton\models\utility::subvalue_sort()
  // should not be called statically in /vendor/default/autoload.php on line 169"
  $utility = new \PHPSkeleton\models\utility();

  \phpskeleton\models\utility::include_all_files_in_directory($_SERVER["PATH_TO_VENDOR"] . "default/models");

  // Cet core settings - default settings that propogate across all sites.
  require_once $_SERVER["PATH_TO_VENDOR"] . "default/settings/settings.php";
  $final_global_template_vars = array_merge($final_global_template_vars, $default_core_settings);

  // Get the site settings (default_global_settings) if it exists.
  if(file_exists($_SERVER["DOCUMENT_ROOT"] . "/default_global_settings.php")){
    require_once $_SERVER["DOCUMENT_ROOT"] . "/default_global_settings.php";
    $final_global_template_vars = array_merge($final_global_template_vars, $default_global_settings);
  }else{
    $default_global_settings = array();
  }

  // Determine which module we are in.
  $current_module_name = basename(dirname($_SERVER["PHP_SELF"]));
  if(!$current_module_name){
    // Find the default 'site' module used for housing resources for the entire site,
    // as well as root level requests.
    $current_module_name = basename($final_global_template_vars["default_site_module"]);
    $current_module_location = $final_global_template_vars["default_site_module"];
  }else{
    $current_module_location = $_SERVER["DOCUMENT_ROOT"]. dirname($_SERVER["PHP_SELF"]);
  }

  $final_global_template_vars["active_module"] = $current_module_name;
  $final_global_template_vars["path_to_this_module"] = dirname($_SERVER["PHP_SELF"]);
  $final_global_template_vars["absolute_path_to_this_module"] = $current_module_location;

  if(!empty($final_global_template_vars["default_site_module"]) && $current_module_location != $final_global_template_vars["default_site_module"]){
    \phpskeleton\models\utility::include_all_files_in_directory($final_global_template_vars["default_site_module"] . '/controllers',true);
  }

  require_once $current_module_location . "/config/settings.php";
  require_once $current_module_location . "/config/includes.php";
  // Include all of the controller functions.
  \phpskeleton\models\utility::include_all_files_in_directory($current_module_location . '/controllers',true);

  // Feel free to unset keys that are in the default_global_settings/default_module_includes
  // js and css includes if you don't want them in this module.
  $final_global_template_vars["js_includes"] = array_merge($final_global_template_vars["js_includes"], $default_module_includes["js"]);
  $final_global_template_vars["css_includes"] = array_merge($final_global_template_vars["css_includes"], $default_module_includes["css"]);
  // USE THIS VARIABLE IN YOUR ROUTES!! Do not use $default_module_settings.
  $final_global_template_vars = array_merge($final_global_template_vars, $default_module_settings);

  // Prepare the app.
  $app = new \Slim\Slim(array(
      'view' => new \Slim\Views\Twig()
      ,"templates.path" => $_SERVER["DOCUMENT_ROOT"]
      ,"mode" => (empty($final_global_template_vars["is_dev"])) ? "production" : "development"
      ,"debug" => (empty($final_global_template_vars["is_dev"])) ? false : true
      ,'log.enabled' => false
      ,'cookies.httponly' => true
  ));

  // Documentation for Slim Views and Twig integration:
  // https://github.com/codeguy/Slim-Views

  $app->view()->parserDirectory = $_SERVER["PATH_TO_VENDOR"]."twig/twig/lib/Twig";

  // Supply paths to all possible template locations.
  $app->view()->twigTemplateDirs = array(
    $current_module_location . "/templates"
    ,isset($final_global_template_vars["site_templates"]) ? $final_global_template_vars["site_templates"] : null
    ,$final_global_template_vars["core_templates"]
    ,$_SERVER["DOCUMENT_ROOT"]
  );

  $twig = $app->view->getEnvironment();

  $twig->parserOptions = array(
    'debug' => true
  );

  $twig->parserExtensions = array(
    new Twig_Extension_Debug()
  );

  // Redirect to https if we are told to.
  if(!empty($final_global_template_vars["force_ssl"])){
    force_ssl();
  }

  // Add CSRF tokens to session and make available to twig.
  if($app->request()->getMethod() == 'GET' || empty($_SESSION[$final_global_template_vars["csrf_key"]])) {
    $uuid = \phpskeleton\models\utility::gen_uuid();
    $final_global_template_vars["csrf_token"] = $uuid;
    $_SESSION[$final_global_template_vars["csrf_key"]] = $final_global_template_vars["csrf_token"];
  } else {
    $final_global_template_vars["csrf_token"] = $_SESSION[$final_global_template_vars["csrf_key"]];
  }

  // Create an array of all the modules.
  $modules_list_array = array();
  $visible_module_count = 0;

  // Need to know where all the modules are.
  if(empty($final_global_template_vars["module_locations"]) || !is_array($final_global_template_vars["module_locations"])){
    $final_global_template_vars["module_locations"] = array(dirname($current_module_location));
  }
  foreach($final_global_template_vars["module_locations"] as $single_location){

    if ($handle = opendir($single_location)) {

      while (false !== ($entry = readdir($handle))) {

        $default_module_settings = false;

        if ($entry != "." && $entry != ".." && is_dir($single_location . "/" . $entry)) {

          if(is_file($single_location . "/" . $entry . "/config/settings.php") && is_file($single_location . "/" . $entry . "/config/routes.php")) {

            // Check to see if a whitelist exists, and if so, that it is in it.
            $total_list_check = true;
            $white_list_check = true;
            $black_list_check = true;

            if(!empty($final_global_template_vars["module_whitelist"]) && !in_array($entry,$final_global_template_vars["module_whitelist"])) {
              $white_list_check = false;
            } elseif(!empty($final_global_template_vars["module_blacklist"]) && in_array($entry,$final_global_template_vars["module_blacklist"])) {
              $black_list_check = false;
            }
            if(!$white_list_check || !$black_list_check){
              $total_list_check = false;
            }

            if($total_list_check) {

              require $single_location . "/" . $entry . "/config/settings.php";

              $default_module_settings["handle"] = $entry;

              if(empty($default_module_settings["sort_order"])) {
                $default_module_settings["sort_order"] = '100';
              }

              if(!empty($default_module_settings["menu_hidden"])) {
                // The module is hidden, do not check if any pages are visible.
              } else {
                if(!empty($default_module_settings["pages"]) && is_array($default_module_settings["pages"])) {

                  $default_module_settings["menu_hidden"] = true;
                  foreach($default_module_settings["pages"] as $single_page) {
                    // Check to see if the display is callable.
                    if(isset($single_page["display"]) && is_callable($single_page["display"])) {
                      $single_page["display"] = call_user_func($single_page["display"],false);
                    }

                    // Must use isset here.
                    if(isset($single_page["display"]) && $single_page["display"] === false) {
                      // Told not to display, so do nothing.
                    } else {
                      $visible_module_count++;
                      $default_module_settings["menu_hidden"] = false;
                      break;
                    }
                  }
                } else {
                  // If there are no pages to display, don't display the menu.
                  $default_module_settings["menu_hidden"] = true;
                }
              }
              $default_module_settings["absolute_path_to_this_module"] = $single_location . "/" . $entry;
              $default_module_settings["path_to_this_module"] = str_replace($_SERVER["DOCUMENT_ROOT"],"",$default_module_settings["absolute_path_to_this_module"]);
              $modules_list_array[$entry] = array_merge($default_global_settings,$default_module_settings);
            }
          }
        }
      }
      closedir($handle);
    }
  }

  // Changed from static call to instanciated due to PHP errors - by Gor, gor@webcraftr.com, 2013-07-16
  // "PHP Strict Standards:  Non-static method phpskeleton\models\utility::subvalue_sort()
  // should not be called statically in /vendor/default/autoload.php on line 169"
  $modules_list_array = $utility->subvalue_sort($modules_list_array, 'sort_order');
  $final_global_template_vars["default_module_list"] = $modules_list_array;
  $final_global_template_vars["visible_module_count"] = $visible_module_count;

  foreach($final_global_template_vars as $var_name => $var_value){
    $twig->addGlobal($var_name, $var_value);
  }

  $twig->addGlobal("is_authenticated", (isset($final_global_template_vars["session_key"]) && isset($_SESSION[$final_global_template_vars["session_key"]])) ? true : false);
  $twig->addGlobal("session",$_SESSION);
  $twig->addGlobal("request_uri",$_SERVER["REQUEST_URI"]);

  // Define routes.
  require_once $current_module_location . "/config/routes.php";

  // Log page load.
  if(isset($final_global_template_vars["log_page_load"]) && $final_global_template_vars["log_page_load"]){
    $app->hook('slim.after', function () use ($app, $final_global_template_vars) {
      $log_params = array(
        $_SERVER["REMOTE_ADDR"]
        ,$_SERVER["HTTP_USER_AGENT"]
        ,$_SERVER["HTTP_HOST"]
        ,$_SERVER["REQUEST_URI"]
        ,isset($_SERVER["HTTP_REFERER"]) ? $_SERVER["HTTP_REFERER"] : ""
        ,(isset($_SESSION[$final_global_template_vars["session_key"]]) && isset($_SESSION[$final_global_template_vars["session_key"]]['cn'])) ? $_SESSION[$final_global_template_vars["session_key"]]['cn'] : ""
        ,$final_global_template_vars["active_module"]
      );
      $log_db = new \PHPSkeleton\models\db($final_global_template_vars["core_framework_db"]);
      $log_db_resource = $log_db->get_resource();
      $statement = $log_db_resource->prepare("
        INSERT INTO page_load
          (ip_address
          ,http_user_agent
          ,domain
          ,page
          ,created_date
          ,referer
          ,cn
          ,module)
        VALUES
          (?,?,?,?,NOW(),?,?,?)");
      $statement->execute($log_params);
      $log_db->close_connection();
    });
  }

  $app->config('final_global_template_vars', $final_global_template_vars);

  // Run the app.
  $app->run();
?>


text:
package org.apache.geronimo.j2ee.management.impl;

import java.util.Hashtable;
import java.util.Collection;
import javax.management.ObjectName;

import org.apache.geronimo.gbean.GBeanInfo;
import org.apache.geronimo.gbean.GBeanInfoBuilder;
import org.apache.geronimo.kernel.ObjectNameUtil;
import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
import org.apache.geronimo.management.geronimo.J2EEDomain;
import org.apache.geronimo.management.geronimo.J2EEServer;

/**
 * @version $Rev$ $Date$
 */
public class J2EEDomainImpl implements J2EEDomain {
    private final String objectName;
    private final Collection servers;

    public J2EEDomainImpl(String objectName, Collection servers) {
        this.objectName = objectName;
        ObjectName myObjectName = ObjectNameUtil.getObjectName(this.objectName);
        verifyObjectName(myObjectName);
        this.servers = servers;
    }

    public String getObjectName() {
        return objectName;
    }

    public boolean isStateManageable() {
        return true;
    }

    public boolean isStatisticsProvider() {
        return false;
    }

    public boolean isEventProvider() {
        return true;
    }

    /**
     * ObjectName must match this pattern:
     * <p/>
     * domain:j2eeType=J2EEDomain,name=domain
     */
    private void verifyObjectName(ObjectName objectName) {
        if (objectName.isPattern()) {
            throw new InvalidObjectNameException("ObjectName can not be a pattern", objectName);
        }
        Hashtable keyPropertyList = objectName.getKeyPropertyList();
        if (!"J2EEDomain".equals(keyPropertyList.get("j2eeType"))) {
            throw new InvalidObjectNameException("J2EEDomain object name j2eeType property must be 'J2EEDomain'", objectName);
        }
        String name = (String) keyPropertyList.get("name");
        if (!objectName.getDomain().equals(name)) {
            throw new InvalidObjectNameException("Domain part of J2EEDomain object name must match name propert", objectName);
        }
    }

    public String[] getServers() {
        return Util.getObjectNames(getServerInstances());
    }

    public J2EEServer[] getServerInstances() {
        if (servers == null) return new J2EEServer[0];
        return (J2EEServer[]) servers.toArray(new J2EEServer[servers.size()]);
    }

    public static final GBeanInfo GBEAN_INFO;

    static {
        GBeanInfoBuilder infoFactory = GBeanInfoBuilder.createStatic(J2EEDomainImpl.class, NameFactory.J2EE_DOMAIN);

        infoFactory.addReference("Servers", J2EEServer.class, NameFactory.J2EE_SERVER);
        infoFactory.setConstructor(new String[]{"objectName", "Servers"});

        GBEAN_INFO = infoFactory.getBeanInfo();
    }

    public static GBeanInfo getGBeanInfo() {
        return GBEAN_INFO;
    }
}


text:
<?php

namespace Controllers\Navigation;

use BusinessLogic\Helpers;
use BusinessLogic\Navigation\CustomNavElement;
use BusinessLogic\Navigation\CustomNavElementHandler;
use Controllers\InternalApiController;
use Controllers\JsonRetriever;

class CustomNavElementController extends InternalApiController {
    static function getAll() {
        global $applicationContext, $hesk_settings;

        self::staticCheckForInternalUseOnly();

        /* @var $handler CustomNavElementHandler */
        $handler = $applicationContext->get(CustomNavElementHandler::clazz());

        output($handler->getAllCustomNavElements($hesk_settings));
    }

    static function sort($id, $direction) {
        global $applicationContext, $hesk_settings;

        self::staticCheckForInternalUseOnly();

        /* @var $handler CustomNavElementHandler */
        $handler = $applicationContext->get(CustomNavElementHandler::clazz());

        $handler->sortCustomNavElement(intval($id), $direction, $hesk_settings);
    }

    function get($id) {
        global $applicationContext, $hesk_settings;

        $this->checkForInternalUseOnly();

        /* @var $handler CustomNavElementHandler */
        $handler = $applicationContext->get(CustomNavElementHandler::clazz());

        output($handler->getCustomNavElement($id, $hesk_settings));
    }

    function post() {
        global $applicationContext, $hesk_settings;

        $this->checkForInternalUseOnly();

        /* @var $handler CustomNavElementHandler */
        $handler = $applicationContext->get(CustomNavElementHandler::clazz());

        $data = JsonRetriever::getJsonData();
        $element = $handler->createCustomNavElement($this->buildElementModel($data), $hesk_settings);

        return output($element, 201);
    }

    function put($id) {
        global $applicationContext, $hesk_settings;

        $this->checkForInternalUseOnly();

        /* @var $handler CustomNavElementHandler */
        $handler = $applicationContext->get(CustomNavElementHandler::clazz());

        $data = JsonRetriever::getJsonData();
        $handler->saveCustomNavElement($this->buildElementModel($data, $id), $hesk_settings);

        return http_response_code(204);
    }

    function delete($id) {
        global $applicationContext, $hesk_settings;

        $this->checkForInternalUseOnly();

        /* @var $handler CustomNavElementHandler */
        $handler = $applicationContext->get(CustomNavElementHandler::clazz());

        $handler->deleteCustomNavElement($id, $hesk_settings);

        return http_response_code(204);
    }

    private function buildElementModel($data, $id = null) {
        $element = new CustomNavElement();
        $element->id = $id;
        $element->place = intval(Helpers::safeArrayGet($data, 'place'));
        $element->fontIcon = Helpers::safeArrayGet($data, 'fontIcon');
        $element->imageUrl = Helpers::safeArrayGet($data, 'imageUrl');
        $element->text = Helpers::safeArrayGet($data, 'text');
        $element->subtext = Helpers::safeArrayGet($data, 'subtext');
        $element->url = Helpers::safeArrayGet($data, 'url');
        $element->sort = intval(Helpers::safeArrayGet($data, 'sort'));

        return $element;
    }
}


text:
<!--
The request to this GraphQL server provided the header "Accept: text/html"
and as a result has been presented GraphiQL - an in-browser IDE for
exploring GraphQL.
If you wish to receive JSON, provide the header "Accept: application/json" or
add "&raw" to the end of the URL within a browser.
-->
<!DOCTYPE html>
<html>
<head>
  <style>
    html, body {
      height: 100%;
      margin: 0;
      overflow: hidden;
      width: 100%;
    }
  </style>
  <link href="//cdn.jsdelivr.net/graphiql/{{graphiql_version}}/graphiql.css" rel="stylesheet" />
  <script src="//cdn.jsdelivr.net/fetch/0.9.0/fetch.min.js"></script>
  <script src="//cdn.jsdelivr.net/react/15.0.0/react.min.js"></script>
  <script src="//cdn.jsdelivr.net/react/15.0.0/react-dom.min.js"></script>
  <script src="//cdn.jsdelivr.net/graphiql/{{graphiql_version}}/graphiql.min.js"></script>
</head>
<body>
  <script>
    // Collect the URL parameters
    var parameters = {};
    window.location.search.substr(1).split('&').forEach(function (entry) {
      var eq = entry.indexOf('=');
      if (eq >= 0) {
        parameters[decodeURIComponent(entry.slice(0, eq))] =
          decodeURIComponent(entry.slice(eq + 1));
      }
    });
    // Produce a Location query string from a parameter object.
    function locationQuery(params) {
      return '?' + Object.keys(params).map(function (key) {
        return encodeURIComponent(key) + '=' +
          encodeURIComponent(params[key]);
      }).join('&');
    }
    // Derive a fetch URL from the current URL, sans the GraphQL parameters.
    var graphqlParamNames = {
      query: true,
      variables: true,
      operationName: true
    };
    var otherParams = {};
    for (var k in parameters) {
      if (parameters.hasOwnProperty(k) && graphqlParamNames[k] !== true) {
        otherParams[k] = parameters[k];
      }
    }
    var fetchURL = locationQuery(otherParams);
    // Defines a GraphQL fetcher using the fetch API.
    function graphQLFetcher(graphQLParams) {
      return fetch(fetchURL, {
        method: 'post',
        headers: {
          'Accept': 'application/json',
          'Content-Type': 'application/json'
        },
        body: JSON.stringify(graphQLParams),
        credentials: 'include',
      }).then(function (response) {
        return response.text();
      }).then(function (responseBody) {
        try {
          return JSON.parse(responseBody);
        } catch (error) {
          return responseBody;
        }
      });
    }
    // When the query and variables string is edited, update the URL bar so
    // that it can be easily shared.
    function onEditQuery(newQuery) {
      parameters.query = newQuery;
      updateURL();
    }
    function onEditVariables(newVariables) {
      parameters.variables = newVariables;
      updateURL();
    }
    function onEditOperationName(newOperationName) {
      parameters.operationName = newOperationName;
      updateURL();
    }
    function updateURL() {
      history.replaceState(null, null, locationQuery(parameters));
    }
    // Render <GraphiQL /> into the body.
    ReactDOM.render(
      React.createElement(GraphiQL, {
        fetcher: graphQLFetcher,
        onEditQuery: onEditQuery,
        onEditVariables: onEditVariables,
        onEditOperationName: onEditOperationName,
        query: {% raw query %},
        response: {% raw result %},
        variables: {% raw variables %},
        operationName: {% raw operation_name %},
      }),
      document.body
    );
  </script>
</body>
</html>


text:
(function () {
    'use strict';

    angular
        .module('app')
        .factory('EmployeeService', Service);

    function Service($http, $q) {
        var service = {};

        service.GetAll = GetAll;

        return service;

        function GetAll() {
            return $http.get('/api/employees').then(handleSuccess, handleError);
        }

        // private functions

        function handleSuccess(res) {
            return res.data;
        }

        function handleError(res) {
            return $q.reject(res.data);
        }
    }

})();


text:
/**
 * ...
 */
define("tinymce/imagetoolsplugin/Dialog", [
	"tinymce/dom/DOMUtils",
	"tinymce/util/Tools",
	"tinymce/util/Promise",
	"tinymce/ui/Factory",
	"tinymce/ui/Form",
	"tinymce/ui/Container",
	"tinymce/imagetoolsplugin/ImagePanel",
	"tinymce/imagetoolsplugin/ImageTools",
	"tinymce/imagetoolsplugin/Filters",
	"tinymce/imagetoolsplugin/Conversions",
	"tinymce/imagetoolsplugin/UndoStack"
], function(DOMUtils, Tools, Promise, Factory, Form, Container, ImagePanel, ImageTools, Filters, Conversions, UndoStack) {
	function createState(blob) {
		return {
			blob: blob,
			url: URL.createObjectURL(blob)
		};
	}

	function destroyState(state) {
		if (state) {
			URL.revokeObjectURL(state.url);
		}
	}

	function destroyStates(states) {
		Tools.each(states, destroyState);
	}

	function open(currentState, resolve, reject) {
		var win, undoStack = new UndoStack(), mainPanel, filtersPanel, tempState,
			cropPanel, resizePanel, flipRotatePanel, imagePanel, sidePanel, mainViewContainer,
			invertPanel, brightnessPanel, huePanel, saturatePanel, contrastPanel, grayscalePanel,
			sepiaPanel, colorizePanel, sharpenPanel, embossPanel, gammaPanel, exposurePanel, panels,
			width, height, ratioW, ratioH;

		function recalcSize(e) {
			var widthCtrl, heightCtrl, newWidth, newHeight;

			widthCtrl = win.find('#w')[0];
			heightCtrl = win.find('#h')[0];

			newWidth = parseInt(widthCtrl.value(), 10);
			newHeight = parseInt(heightCtrl.value(), 10);

			if (win.find('#constrain')[0].checked() && width && height && newWidth && newHeight) {
				if (e.control.settings.name == 'w') {
					newHeight = Math.round(newWidth * ratioW);
					heightCtrl.value(newHeight);
				} else {
					newWidth = Math.round(newHeight * ratioH);
					widthCtrl.value(newWidth);
				}
			}

			width = newWidth;
			height = newHeight;
		}

		function floatToPercent(value) {
			return Math.round(value * 100) + '%';
		}

		function updateButtonUndoStates() {
			win.find('#undo').disabled(!undoStack.canUndo());
			win.find('#redo').disabled(!undoStack.canRedo());
			win.statusbar.find('#save').disabled(!undoStack.canUndo());
		}

		function disableUndoRedo() {
			win.find('#undo').disabled(true);
			win.find('#redo').disabled(true);
		}

		function displayState(state) {
			if (state) {
				imagePanel.imageSrc(state.url);
			}
		}

		function switchPanel(targetPanel) {
			return function() {
				var hidePanels = Tools.grep(panels, function(panel) {
					return panel.settings.name != targetPanel;
				});

				Tools.each(hidePanels, function(panel) {
					panel.hide();
				});

				targetPanel.show();
			};
		}

		function addTempState(blob) {
			tempState = createState(blob);
			displayState(tempState);
		}

		function addBlobState(blob) {
			currentState = createState(blob);
			displayState(currentState);
			destroyStates(undoStack.add(currentState).removed);
			updateButtonUndoStates();
		}

		function crop() {
			var rect = imagePanel.selection();

			ImageTools.crop(currentState.blob, rect.x, rect.y, rect.w, rect.h).then(function(blob) {
				addBlobState(blob);
				cancel();
			});
		}

		function tempAction(fn) {
			var args = [].slice.call(arguments, 1);

			return function() {
				var state = tempState || currentState;

				fn.apply(this, [state.blob].concat(args)).then(addTempState);
			};
		}

		function action(fn) {
			var args = [].slice.call(arguments, 1);

			return function() {
				fn.apply(this, [currentState.blob].concat(args)).then(addBlobState);
			};
		}

		function cancel() {
			displayState(currentState);
			destroyState(tempState);
			switchPanel(mainPanel)();
			updateButtonUndoStates();
		}

		function applyTempState() {
			if (tempState) {
				addBlobState(tempState.blob);
				cancel();
			}
		}

		function zoomIn() {
			var zoom = imagePanel.zoom();

			if (zoom < 2) {
				zoom += 0.1;
			}

			imagePanel.zoom(zoom);
		}

		function zoomOut() {
			var zoom = imagePanel.zoom();

			if (zoom > 0.1) {
				zoom -= 0.1;
			}

			imagePanel.zoom(zoom);
		}

		function undo() {
			currentState = undoStack.undo();
			displayState(currentState);
			updateButtonUndoStates();
		}

		function redo() {
			currentState = undoStack.redo();
			displayState(currentState);
			updateButtonUndoStates();
		}

		function save() {
			resolve(currentState.blob);
			win.close();
		}

		function createPanel(items) {
			return new Form({
				layout: 'flex',
				direction: 'row',
				labelGap: 5,
				border: '0 0 1 0',
				align: 'center',
				pack: 'center',
				padding: '0 10 0 10',
				spacing: 5,
				flex: 0,
				minHeight: 60,
				defaults: {
					classes: 'imagetool',
					type: 'button'
				},
				items: items
			});
		}

		function createFilterPanel(title, filter) {
			return createPanel([
				{text: 'Back', onclick: cancel},
				{type: 'spacer', flex: 1},
				{text: 'Apply', subtype: 'primary', onclick: applyTempState}
			]).hide().on('show', function() {
				disableUndoRedo();

				filter(currentState.blob).then(function(blob) {
					var newTempState = createState(blob);

					displayState(newTempState);
					destroyState(tempState);
					tempState = newTempState;
				});
			});
		}

		function createVariableFilterPanel(title, filter, value, min, max) {
			function update(value) {
				filter(currentState.blob, value).then(function(blob) {
					var newTempState = createState(blob);
					displayState(newTempState);
					destroyState(tempState);
					tempState = newTempState;
				});
			}

			return createPanel([
				{text: 'Back', onclick: cancel},
				{type: 'spacer', flex: 1},
				{
					type: 'slider',
					flex: 1,
					ondragend: function(e) {
						update(e.value);
					},
					minValue: min,
					maxValue: max,
					value: value,
					previewFilter: floatToPercent
				},
				{type: 'spacer', flex: 1},
				{text: 'Apply', subtype: 'primary', onclick: applyTempState}
			]).hide().on('show', function() {
				this.find('slider').value(value);
				disableUndoRedo();
			});
		}

		function createRgbFilterPanel(title, filter) {
			function update() {
				var r, g, b;

				r = win.find('#r')[0].value();
				g = win.find('#g')[0].value();
				b = win.find('#b')[0].value();

				filter(currentState.blob, r, g, b).then(function(blob) {
					var newTempState = createState(blob);
					displayState(newTempState);
					destroyState(tempState);
					tempState = newTempState;
				});
			}

			return createPanel([
				{text: 'Back', onclick: cancel},
				{type: 'spacer', flex: 1},
				{
					type: 'slider', label: 'R', name: 'r', minValue: 0,
					value: 1, maxValue: 2, ondragend: update, previewFilter: floatToPercent
				},
				{
					type: 'slider', label: 'G', name: 'g', minValue: 0,
					value: 1, maxValue: 2, ondragend: update, previewFilter: floatToPercent
				},
				{
					type: 'slider', label: 'B', name: 'b', minValue: 0,
					value: 1, maxValue: 2, ondragend: update, previewFilter: floatToPercent
				},
				{type: 'spacer', flex: 1},
				{text: 'Apply', subtype: 'primary', onclick: applyTempState}
			]).hide().on('show', function() {
				win.find('#r,#g,#b').value(1);
				disableUndoRedo();
			});
		}

		cropPanel = createPanel([
			{text: 'Back', onclick: cancel},
			{type: 'spacer', flex: 1},
			{text: 'Apply', subtype: 'primary', onclick: crop}
		]).hide().on('show hide', function(e) {
			imagePanel.toggleCropRect(e.type == 'show');
		}).on('show', disableUndoRedo);

		function toggleConstrain(e) {
			if (e.control.value() === true) {
				ratioW = height / width;
				ratioH = width / height;
			}
		}

		resizePanel = createPanel([
			{text: 'Back', onclick: cancel},
			{type: 'spacer', flex: 1},
			{type: 'textbox', name: 'w', label: 'Width', size: 4, onkeyup: recalcSize},
			{type: 'textbox', name: 'h', label: 'Height', size: 4, onkeyup: recalcSize},
			{type: 'checkbox', name: 'constrain', text: 'Constrain proportions', checked: true, onchange: toggleConstrain},
			{type: 'spacer', flex: 1},
			{text: 'Apply', subtype: 'primary', onclick: 'submit'}
		]).hide().on('submit', function(e) {
			var width = parseInt(win.find('#w').value(), 10),
				height = parseInt(win.find('#h').value(), 10);

			e.preventDefault();

			action(ImageTools.resize, width, height)();
			cancel();
		}).on('show', disableUndoRedo);

		flipRotatePanel = createPanel([
			{text: 'Back', onclick: cancel},
			{type: 'spacer', flex: 1},
			{icon: 'fliph', tooltip: 'Flip horizontally', onclick: tempAction(ImageTools.flip, 'h')},
			{icon: 'flipv', tooltip: 'Flip vertically', onclick: tempAction(ImageTools.flip, 'v')},
			{icon: 'rotateleft', tooltip: 'Rotate counterclockwise', onclick: tempAction(ImageTools.rotate, -90)},
			{icon: 'rotateright', tooltip: 'Rotate clockwise', onclick: tempAction(ImageTools.rotate, 90)},
			{type: 'spacer', flex: 1},
			{text: 'Apply', subtype: 'primary', onclick: applyTempState}
		]).hide().on('show', disableUndoRedo);

		invertPanel = createFilterPanel("Invert", Filters.invert);
		sharpenPanel = createFilterPanel("Sharpen", Filters.sharpen);
		embossPanel = createFilterPanel("Emboss", Filters.emboss);

		brightnessPanel = createVariableFilterPanel("Brightness", Filters.brightness, 0, -1, 1);
		huePanel = createVariableFilterPanel("Hue", Filters.hue, 180, 0, 360);
		saturatePanel = createVariableFilterPanel("Saturate", Filters.saturate, 0, -1, 1);
		contrastPanel = createVariableFilterPanel("Contrast", Filters.contrast, 0, -1, 1);
		grayscalePanel = createVariableFilterPanel("Grayscale", Filters.grayscale, 0, 0, 1);
		sepiaPanel = createVariableFilterPanel("Sepia", Filters.sepia, 0, 0, 1);
		colorizePanel = createRgbFilterPanel("Colorize", Filters.colorize);
		gammaPanel = createVariableFilterPanel("Gamma", Filters.gamma, 0, -1, 1);
		exposurePanel = createVariableFilterPanel("Exposure", Filters.exposure, 1, 0, 2);

		filtersPanel = createPanel([
			{text: 'Back', onclick: cancel},
			{type: 'spacer', flex: 1},
			{text: 'hue', icon: 'hue', onclick: switchPanel(huePanel)},
			{text: 'saturate', icon: 'saturate', onclick: switchPanel(saturatePanel)},
			{text: 'sepia', icon: 'sepia', onclick: switchPanel(sepiaPanel)},
			{text: 'emboss', icon: 'emboss', onclick: switchPanel(embossPanel)},
			{text: 'exposure', icon: 'exposure', onclick: switchPanel(exposurePanel)},
			{type: 'spacer', flex: 1}
		]).hide();

		mainPanel = createPanel([
			{tooltip: 'Crop', icon: 'crop', onclick: switchPanel(cropPanel)},
			{tooltip: 'Resize', icon: 'resize2', onclick: switchPanel(resizePanel)},
			{tooltip: 'Orientation', icon: 'orientation', onclick: switchPanel(flipRotatePanel)},
			{tooltip: 'Brightness', icon: 'sun', onclick: switchPanel(brightnessPanel)},
			{tooltip: 'Sharpen', icon: 'sharpen', onclick: switchPanel(sharpenPanel)},
			{tooltip: 'Contrast', icon: 'contrast', onclick: switchPanel(contrastPanel)},
			{tooltip: 'Color levels', icon: 'drop', onclick: switchPanel(colorizePanel)},
			{tooltip: 'Gamma', icon: 'gamma', onclick: switchPanel(gammaPanel)},
			{tooltip: 'Invert', icon: 'invert', onclick: switchPanel(invertPanel)}
			//{text: 'More', onclick: switchPanel(filtersPanel)}
		]);

		imagePanel = new ImagePanel({
			flex: 1,
			imageSrc: currentState.url
		});

		sidePanel = new Container({
			layout: 'flex',
			direction: 'column',
			border: '0 1 0 0',
			padding: 5,
			spacing: 5,
			items: [
				{type: 'button', icon: 'undo', tooltip: 'Undo', name: 'undo', onclick: undo},
				{type: 'button', icon: 'redo', tooltip: 'Redo', name: 'redo', onclick: redo},
				{type: 'button', icon: 'zoomin', tooltip: 'Zoom in', onclick: zoomIn},
				{type: 'button', icon: 'zoomout', tooltip: 'Zoom out', onclick: zoomOut}
			]
		});

		mainViewContainer = new Container({
			type: 'container',
			layout: 'flex',
			direction: 'row',
			align: 'stretch',
			flex: 1,
			items: [sidePanel, imagePanel]
		});

		panels = [
			mainPanel,
			cropPanel,
			resizePanel,
			flipRotatePanel,
			filtersPanel,
			invertPanel,
			brightnessPanel,
			huePanel,
			saturatePanel,
			contrastPanel,
			grayscalePanel,
			sepiaPanel,
			colorizePanel,
			sharpenPanel,
			embossPanel,
			gammaPanel,
			exposurePanel
		];

		win = Factory.create('window', {
			layout: 'flex',
			direction: 'column',
			align: 'stretch',
			minWidth: Math.min(DOMUtils.DOM.getViewPort().w, 800),
			minHeight: Math.min(DOMUtils.DOM.getViewPort().h, 650),
			title: 'Edit image',
			items: panels.concat([mainViewContainer]),
			buttons: [
				{text: 'Save', name: 'save', subtype: 'primary', onclick: save},
				{text: 'Cancel', onclick: 'close'}
			]
		});

		win.renderTo(document.body).reflow();

		win.on('close', function() {
			reject();
			destroyStates(undoStack.data);
			undoStack = null;
			tempState = null;
		});

		undoStack.add(currentState);
		updateButtonUndoStates();

		imagePanel.on('load', function() {
			width = imagePanel.imageSize().w;
			height = imagePanel.imageSize().h;
			ratioW = height / width;
			ratioH = width / height;

			win.find('#w').value(width);
			win.find('#h').value(height);
		});
	}

	function edit(blob) {
		return new Promise(function(resolve, reject) {
			open(createState(blob), resolve, reject);
		});
	}

	//edit('img/dogleft.jpg');

	return {
		edit: edit
	};
});


text:
package info.novatec.beantest.demo.ejb;

import info.novatec.beantest.demo.mocks.ExternalServicesMockProducer;
import org.apache.deltaspike.testcontrol.api.junit.CdiTestRunner;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mockito;

import javax.inject.Inject;

import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;

@RunWith(CdiTestRunner.class)
public class DeltaSpikeMockProducerTest {

    @Inject
    private MyEjbServiceThatCallsAnExternalService service;

    @Test
    public void shouldCallExternalServiceMock() {
        MyExternalService externalService = ExternalServicesMockProducer.getExternalService();
        //Since the ExternalServicesMockProducer returns a Mockito mock, we can initialize it
        Mockito.when(externalService.doSomething()).thenReturn("Hello World");

        assertThat(service.callExternalService(), is("Hello World"));
    }
}


text:
.no-margin-bottom {
    margin-bottom: 0;
}
.button-row {
    margin-bottom: 20px;
}
.dashboard-button {
    width: 100%;
    height: 120px;
    padding: 35px;
}
.margin-top-30 {
    margin-top: 30px;
}
.margin-bottom-30 {
    margin-bottom: 30px;
}
.textarea_full {
    width: 100%;
}
.correct {
    border: 1px solid greenyellow;
}
div.neutral-border {
    border: 1px solid lightgrey;
    border-radius: 5px;
}
div.centered-div {
    text-align: center;
    padding: 0 100px;
}
.popover-title {
    color: white;
    font-weight: bold;
    text-align: center;
    background-color: red;
}
.main_body_container {
    background-color: #dddddd;
    min-height: 100%;
}
.main_content_container {
    width: 100%;
}
body {
    background-image: url("/local.realestate/assets/imgs/body_background.jpg");
}
.information_modal_toggler {
    cursor: pointer;
}
div.map_container {
    height: 80%;
}


text:
package org.jbpm.process.instance.impl.demo;

import org.kie.api.runtime.process.WorkItem;
import org.kie.api.runtime.process.WorkItemHandler;
import org.kie.api.runtime.process.WorkItemManager;

/**
 *
 */
public class SystemOutWorkItemHandler implements WorkItemHandler {

    public void executeWorkItem(WorkItem workItem, WorkItemManager manager) {
        System.out.println("Executing work item " + workItem);
        manager.completeWorkItem(workItem.getId(), null);
    }

    public void abortWorkItem(WorkItem workItem, WorkItemManager manager) {
        System.out.println("Aborting work item " + workItem);
        manager.abortWorkItem(workItem.getId());
    }

}


text:
import { RightSideBarService } from './Services/rightSideBar.service'
import { Component } from '@angular/core';
import { ROUTER_DIRECTIVES } from '@angular/router';
import { PolymerElement } from '@vaadin/angular2-polymer';

@Component({
  selector: 'my-app',
  templateUrl: `app/AppComponent/app.component.html`,
  styleUrls:['app/AppComponent/app.component.css'],
  directives: [
    ROUTER_DIRECTIVES,
    PolymerElement('app-header-layout'),
    PolymerElement('app-header'),
    PolymerElement('app-toolbar'),
    PolymerElement('paper-icon-button'),
    PolymerElement('app-drawer'),
    PolymerElement('app-toolbar'),
    PolymerElement('paper-button'),
    PolymerElement('app-drawer-layout'),
    PolymerElement('paper-input'),
    PolymerElement('paper-item'),
    PolymerElement('paper-menu'),
    PolymerElement('paper-submenu')
  ],
  providers:[ RightSideBarService ]
})

export class AppComponent{
  public mainTitle:string="MAIN";
  public sideState:boolean=false;
  public rightSideState:boolean=true;

  constructor( public sidebarService:RightSideBarService ){}

  OpenRight(){
    this.rightSideState=true;
    this.sidebarService.emit('open');
  }

  CloseRight(){
    this.rightSideState=false;
    this.sidebarService.emit('close')
  }

  onArrow(value:any){
    let arrow=value.innerHTML;
    if( arrow == 'keyboard_arrow_down' ){
      value.innerHTML = 'keyboard_arrow_up';
    } else {
      value.innerHTML = 'keyboard_arrow_down';
    }
  }

  openLeft(){
    document.getElementById("leftSidebar").style.width = "250px";
    if(window.innerHeight>800 && window.innerWidth>800){
      document.getElementById("main").style.marginLeft = "250px";
    }
    this.sideState=false;
  }

  closeLeft(){
    document.getElementById("leftSidebar").style.width = "0px";
    document.getElementById("main").style.marginLeft = "0px";
    this.sideState=true;
  }

}