text:
package org.andengine.ui.activity;

import org.andengine.entity.scene.Scene;
import org.andengine.util.ActivityUtils;
import org.andengine.util.call.Callback;
import org.andengine.util.progress.IProgressListener;
import org.andengine.util.progress.ProgressCallable;

/**
 * (c) Zynga 2011
 *
 * @author Nicolas Gramlich <ngramlich@zynga.com>
 * @since 01:24:18 - 03.12.2011
 */
public abstract class SimpleAsyncGameActivity extends BaseGameActivity {
	// ===========================================================
	// Constants
	// ===========================================================

	// ===========================================================
	// Fields
	// ===========================================================

	// ===========================================================
	// Constructors
	// ===========================================================

	// ===========================================================
	// Getter & Setter
	// ===========================================================

	// ===========================================================
	// Methods for/from SuperClass/Interfaces
	// ===========================================================

	public abstract void onCreateResourcesAsync(final IProgressListener pProgressListener) throws Exception; // TODO
																												// Rename

	public abstract Scene onCreateSceneAsync(final IProgressListener pProgressListener) throws Exception; // TODO
																											// Rename

	public abstract void onPopulateSceneAsync(final Scene pScene, IProgressListener pProgressListener) throws Exception; // TODO
																															// Rename

	@Override
	public void onCreateResources(final OnCreateResourcesCallback pOnCreateResourcesCallback) {
		this.runOnUiThread(new Runnable() {
			@Override
			public void run() {
				ActivityUtils.doProgressAsync(SimpleAsyncGameActivity.this, "Loading Resources...", android.R.drawable.ic_menu_rotate,
						new ProgressCallable<Void>() {
							@Override
							public Void call(final IProgressListener pProgressListener) throws Exception {
								SimpleAsyncGameActivity.this.onCreateResourcesAsync(pProgressListener);

								pProgressListener.onProgressChanged(100);

								pOnCreateResourcesCallback.onCreateResourcesFinished();

								return null;
							}
						}, new Callback<Void>() {
							@Override
							public void onCallback(final Void pCallbackValue) {
								/* Nothing. */
							}
						});
			}
		});
	}

	@Override
	public void onCreateScene(final OnCreateSceneCallback pOnCreateSceneCallback) {
		this.runOnUiThread(new Runnable() {
			@Override
			public void run() {
				ActivityUtils.doProgressAsync(SimpleAsyncGameActivity.this, "Loading Scene...", android.R.drawable.ic_menu_rotate,
						new ProgressCallable<Void>() {
							@Override
							public Void call(final IProgressListener pProgressListener) throws Exception {
								final Scene scene = SimpleAsyncGameActivity.this.onCreateSceneAsync(pProgressListener);

								pProgressListener.onProgressChanged(100);

								pOnCreateSceneCallback.onCreateSceneFinished(scene);

								return null;
							}
						}, new Callback<Void>() {
							@Override
							public void onCallback(final Void pCallbackValue) {
								/* Nothing. */
							}
						});
			}
		});
	}

	@Override
	public void onPopulateScene(final Scene pScene, final OnPopulateSceneCallback pOnPopulateSceneCallback) {
		this.runOnUiThread(new Runnable() {
			@Override
			public void run() {
				ActivityUtils.doProgressAsync(SimpleAsyncGameActivity.this, "Populating Scene...", android.R.drawable.ic_menu_rotate,
						new ProgressCallable<Void>() {
							@Override
							public Void call(final IProgressListener pProgressListener) throws Exception {
								SimpleAsyncGameActivity.this.onPopulateSceneAsync(pScene, pProgressListener);

								pProgressListener.onProgressChanged(100);

								pOnPopulateSceneCallback.onPopulateSceneFinished();

								return null;
							}
						}, new Callback<Void>() {
							@Override
							public void onCallback(final Void pCallbackValue) {
								/* Nothing. */
							}
						});
			}
		});
	}

	// ===========================================================
	// Methods
	// ===========================================================

	// ===========================================================
	// Inner and Anonymous Classes
	// ===========================================================
}


text:
package com.servlet;

import com.google.inject.MembersInjector;
import com.google.inject.TypeLiteral;
import com.google.inject.spi.TypeEncounter;
import com.google.inject.spi.TypeListener;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.lang.reflect.Field;
import java.util.Arrays;
import java.util.logging.Logger;

public class MyServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        resp.getWriter().println("ID = " + Arrays.toString(req.getParameterValues("id")));
    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        if (req.getRequestURI().equals("/echo/post")) {
            resp.sendRedirect("/echo/get?id=" + req.getParameter("id"));
        } else {
            resp.setStatus(404);
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
/*-----------------------------------------------------------------------
 Factorizacion version
 ------------------------------------------------------------------------*/
#ifndef _FACTORIZATION
#define _FACTORIZATION

#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <stdio.h>
#include <libcdsTrees.h>
#include <BitSequence.h>

namespace cds_static
{
	class factorization
	{
		private:
			factorization();
		public:
			uint listLength;	 //longitud de la lista
            unsigned char nLevels;		 //numero de niveles de arrays
			uint * levelsIndex;	 //inicio de cada array
            unsigned char * levels;		 //array con los bytes
			BitSequence * bS;	 //bitmap para indicar fin de codigo
			uint * rankLevels;	 //rank de 1s hasta el principio de cada array

			/*Susana implementation of Directly Addressable Variable-Length Codes with blocks of size 4
			 * @param list Array with the values
			 * @param l_Length Size of the array
			 * */
			factorization(uint *list,uint l_Length);
			virtual uint access(uint param);
			virtual uint access_seq(uint param, size_t *next_pos, bool dir);
			virtual void save(ostream & fp);
			virtual uint getSize();
			static factorization* load(istream & fp);
			virtual ~factorization();
	};
};
#endif


text: <input type="text" class="form-control" placeholder="01/12/15 4:47:41PM" aria-describedby="basic-addon2">


text:
package com.gemstone.gemfire.internal.cache;

import com.gemstone.gemfire.cache.*;
import com.gemstone.gemfire.internal.i18n.LocalizedStrings;

/**
 * TXEntryUserAttrState is the entity that tracks transactional changes
 * to an entry user attribute.
 *
 * @author Darrel Schneider
 *
 * @since 4.0
 *
 */
public class TXEntryUserAttrState {
  private final Object originalValue;
  private Object pendingValue;

  public TXEntryUserAttrState(Object originalValue)
  {
    this.originalValue = originalValue;
    this.pendingValue = originalValue;
  }
  public Object getOriginalValue() {
    return this.originalValue;
  }
  public Object getPendingValue() {
    return this.pendingValue;
  }
  public Object setPendingValue(Object pv) {
    Object result = this.pendingValue;
    this.pendingValue = pv;
    return result;
  }
  void checkForConflict(LocalRegion r, Object key) throws CommitConflictException {
    Object curCmtValue = r.basicGetEntryUserAttribute(key);
    if (this.originalValue != curCmtValue) {
      throw new CommitConflictException(LocalizedStrings.TXEntryUserAttrState_ENTRY_USER_ATTRIBUTE_FOR_KEY_0_ON_REGION_1_HAD_ALREADY_BEEN_CHANGED_TO_2.toLocalizedString(new Object[] {key, r.getFullPath(), curCmtValue}));
    }
  }
  void applyChanges(LocalRegion r, Object key) {
    try {
      Region.Entry re = r.getEntry(key);
      re.setUserAttribute(this.pendingValue);
    } catch (CacheRuntimeException ignore) {
      // ignore any exceptions since we have already locked and
      // found no conflicts.
    }
  }
}


text:
package org.lwjgl.vulkan;

/**
 * This extension adds support for the following SPIR-V extension in Vulkan:
 *
 *

 *
{@code SPV_NV_viewport_array2}

 *

 *
 *
which allows a single primitive to be broadcast to multiple viewports and/or multiple layers. A new shader built-in output {@code ViewportMaskNV} is provided, which allows a single primitive to be output to multiple viewports simultaneously. Also, a new SPIR-V decoration is added to control whether the effective viewport index is added into the variable decorated with the {@code Layer} built-in decoration. These capabilities allow a single primitive to be output to multiple layers simultaneously.

 *
 *
This extension allows variables decorated with the {@code Layer} and {@code ViewportIndex} built-ins to be exported from vertex or tessellation shaders, using the {@code ShaderViewportIndexLayerNV} capability.

 *
 *
This extension adds a new {@code ViewportMaskNV} built-in decoration that is available for output variables in vertex, tessellation evaluation, and geometry shaders, and a new {@code ViewportRelativeNV} decoration that can be added on variables decorated with {@code Layer} when using the {@code ShaderViewportMaskNV} capability.

 *
 *
When using GLSL source-based shading languages, the {@code gl_ViewportMask}[] built-in output variable and {@code viewport_relative} layout qualifier from {@code GL_NV_viewport_array2} map to the {@code ViewportMaskNV} and {@code ViewportRelativeNV} decorations, respectively. Behaviour is described in the {@code GL_NV_viewport_array2} extension specification.

 *
 *

Note

 *
 *
The {@code ShaderViewportIndexLayerNV} capability is equivalent to the {@code ShaderViewportIndexLayerEXT} capability added by {@link EXTShaderViewportIndexLayer VK_EXT_shader_viewport_index_layer}.

 *

 *
 *
VK_NV_viewport_array2

 *
 *

 *
Name String

 *
{@code VK_NV_viewport_array2}

 *
Extension Type

 *
Device extension

 *
Registered Extension Number

 *
97

 *
Revision

 *
1

 *
Extension and Version Dependencies

 *

 *
Requires support for Vulkan 1.0

 *

 *
Contact

 *

 *
Daniel Koch dgkoch

 *

 *

 *
 *
Other Extension Metadata

 *
 *

 *
Last Modified Date

 *
2017-02-15

 *
Interactions and External Dependencies

 *

 *
This extension requires {@code SPV_NV_viewport_array2}

 *
This extension provides API support for {@code GL_NV_viewport_array2}

 *
This extension requires the {@code geometryShader} and {@code multiViewport} features.

 *
This extension interacts with the {@code tessellationShader} feature.

 *

 *
Contributors

 *

 *
Piers Daniell, NVIDIA

 *
Jeff Bolz, NVIDIA

 *

 *

 */
public final class NVViewportArray2 {

    /** The extension specification version. */
    public static final int VK_NV_VIEWPORT_ARRAY_2_SPEC_VERSION = 1;

    /** The extension name. */
    public static final String VK_NV_VIEWPORT_ARRAY_2_EXTENSION_NAME = "VK_NV_viewport_array2";

    /** The extension specification version. */
    public static final int VK_NV_VIEWPORT_ARRAY2_SPEC_VERSION = VK_NV_VIEWPORT_ARRAY_2_SPEC_VERSION;

    /** The extension name. */
    public static final String VK_NV_VIEWPORT_ARRAY2_EXTENSION_NAME = VK_NV_VIEWPORT_ARRAY_2_EXTENSION_NAME;

    private NVViewportArray2() {}

}


text:
<?php
/**
 * This function gets called if the current version of WordPress is less than 4.7
 * We are able to make use of filters to actually disable the functionality entirely
 */
function DRA_Disable_Via_Filters() {

    // Filters for WP-API version 1.x
    add_filter( 'json_enabled', '__return_false' );
    add_filter( 'json_jsonp_enabled', '__return_false' );

    // Filters for WP-API version 2.x
    add_filter( 'rest_enabled', '__return_false' );
    add_filter( 'rest_jsonp_enabled', '__return_false' );

}


text:
package org.mifos.application.collectionsheet.persistence;

import org.mifos.application.customer.business.CustomerBO;
import org.mifos.application.customer.business.CustomerMeetingEntity;
import org.mifos.application.customer.client.business.ClientBO;
import org.mifos.application.customer.util.helpers.CustomerLevel;
import org.mifos.application.customer.util.helpers.CustomerStatus;
import org.mifos.application.fees.business.AmountFeeBO;
import org.mifos.application.meeting.business.MeetingBO;
import org.mifos.application.office.business.OfficeBO;
import org.mifos.application.personnel.business.PersonnelBO;
import org.mifos.framework.util.helpers.Constants;

/**
 *
 */
public class ClientBuilder {

    private final CustomerAccountBuilder customerAccountBuilder = new CustomerAccountBuilder();
    private final CustomerLevel customerLevel = CustomerLevel.CLIENT;
    private String name = "Test Center";
    private MeetingBO meeting = new MeetingBuilder().customerMeeting().weekly().every(1).startingToday().build();
    private OfficeBO office = new OfficeBuilder().withGlobalOfficeNum("xxxx-112").build();
    private PersonnelBO loanOfficer;
    private final String searchId = "1.1.1.1";
    private final Short updatedFlag = Constants.NO;
    private final CustomerStatus customerStatus = CustomerStatus.CLIENT_ACTIVE;
    private CustomerBO parentCustomer;

    public ClientBO buildForIntegrationTests() {

        final CustomerMeetingEntity customerMeeting = new CustomerMeetingEntity(meeting, updatedFlag);
        final ClientBO client = new ClientBO(customerLevel, customerStatus, name, office, loanOfficer, customerMeeting,
                searchId, parentCustomer);

        customerAccountBuilder.withCustomer(client).withOffice(office).withLoanOfficer(loanOfficer)
                .buildForIntegrationTests();
        return client;
    }

    public ClientBO buildForUnitTests() {

        final CustomerMeetingEntity customerMeeting = new CustomerMeetingEntity(meeting, updatedFlag);
        final ClientBO client = new ClientBO(customerLevel, customerStatus, name, office, loanOfficer, customerMeeting,
                searchId, parentCustomer);

        customerAccountBuilder.withCustomer(client).withOffice(office).withLoanOfficer(loanOfficer).buildForUnitTests();
        return client;
    }

    public ClientBuilder withName(final String withName) {
        this.name = withName;
        return this;
    }

    public ClientBuilder withMeeting(final MeetingBO withMeeting) {
        this.meeting = withMeeting;
        return this;
    }

    public ClientBuilder withOffice(final OfficeBO withOffice) {
        this.office = withOffice;
        return this;
    }

    public ClientBuilder withLoanOfficer(final PersonnelBO withLoanOfficer) {
        this.loanOfficer = withLoanOfficer;
        return this;
    }

    public ClientBuilder withFee(final AmountFeeBO withFee) {
        customerAccountBuilder.withFee(withFee);
        return this;
    }

    public ClientBuilder withParentCustomer(final CustomerBO withParentCustomer) {
        this.parentCustomer = withParentCustomer;
        return this;
    }
}


text:
> Display images in your terminal

![](screenshot.jpg)

Even [animated gifs](https://github.com/vdemedes/gifi)!

*Currently only supported on iTerm >=2.9.*

## Install

```
$ npm install --save term-img
```

## Usage

```js
const termImg = require('term-img');

function fallback() {
	// do something else when not supported
}

termImg('unicorn.jpg', {fallback});
```

## API

### termImg(input, [options])

#### input

Type: `string` `buffer`

Filepath to an image or an image as a buffer.

#### options

##### width
##### height

Type: `string` `number`

The width and height are given as a number followed by a unit, or the word "auto".

- `N`: N character cells.
- `Npx`: N pixels.
- `N%`: N percent of the session's width or height.
- `auto`: The image's inherent size will be used to determine an appropriate dimension.

##### preserveAspectRatio

Type: `boolean`

Default: `true`

##### fallback

Type: `function`

Default: `() => throw new UnsupportedTerminal()`

Enables you to do something else when the terminal doesn't support images.

## Related

- [term-img-cli](https://github.com/sindresorhus/term-img-cli) - CLI for this module

## License

MIT © [Sindre Sorhus](https://sindresorhus.com)


text:
<!DOCTYPE html>

    <meta charset="UTF-8" />
    <meta name="robots" content="index, follow, all" />
    <title>Thelia\Core\Security\UserProvider\TokenUserProvider | Thelia 2 API</title>

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

        <meta name="MobileOptimized" content="width">
        <meta name="HandheldFriendly" content="true">
        <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1">

                <form id="search-form" action="../../../../search.html" method="GET">

            <input name="search"
                   class="typeahead form-control"
                   type="search"
                   placeholder="Search">
        </form>

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

                </button>
                Thelia 2 API

Classes

Namespaces

Interfaces

Traits

Index

Search

class

Thelia

Core

Security

UserProvider

TokenUserProvider

TokenUserProvider

    class
    TokenUserProvider        extends TokenProvider        implements
        UserProviderInterface

Methods

                    encodeKey(
    UserInterface $user)

No description

from
    TokenProvider

                    decodeKey($key)

No description

from
    TokenProvider

    a

                    getUser($key)

Returns a UserInterface instance

Details

in
    TokenProvider at line 19

    encodeKey(
    UserInterface $user)

Parameters

    UserInterface
                $user

in
    TokenProvider at line 28

    decodeKey($key)

Parameters

                $key

at line 19

            abstract
    a
    getUser($key)

Returns a UserInterface instance

Parameters

                $key
                the unique user key (username, email address, etc.)

Return Value

    a
            UserInterface instance, or null if none was found.

        Generated by Sami, the API Documentation Generator.


text:
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Mycol. Writ. 6: 1062 (1920)

#### Original name
Fomes latistipitatus Lloyd, 1920

### Remarks
null


text:
"""Support for Orbit BHyve sensors."""
import logging

from homeassistant.components.binary_sensor import DEVICE_CLASS_MOISTURE
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import AddEntitiesCallback

from . import BHyveDeviceEntity
from .const import CONF_CLIENT, DEVICE_FLOOD, DOMAIN, EVENT_FS_ALARM
from .util import filter_configured_devices

_LOGGER = logging.getLogger(__name__)

async def async_setup_entry(
    hass: HomeAssistant, entry: ConfigEntry, async_add_entities: AddEntitiesCallback
) -> None:
    """Set up the BHyve binary sensor platform from a config entry."""

    bhyve = hass.data[DOMAIN][entry.entry_id][CONF_CLIENT]

    sensors = []

    # Filter the device list to those that are enabled in options
    devices = filter_configured_devices(entry, await bhyve.devices)

    for device in devices:
        if device.get("type") == DEVICE_FLOOD:
            sensors.append(BHyveFloodSensor(hass, bhyve, device))

    async_add_entities(sensors, True)

class BHyveFloodSensor(BHyveDeviceEntity):
    """Define a BHyve sensor."""

    def __init__(self, hass, bhyve, device):
        """Initialize the sensor."""
        name = "{} flood sensor".format(device.get("name"))
        _LOGGER.info("Creating flood sensor: %s", name)
        super().__init__(hass, bhyve, device, name, "water", DEVICE_CLASS_MOISTURE)

    def _setup(self, device):
        self._available = device.get("is_connected", False)
        self._state = self._parse_status(device.get("status", {}))
        self._attrs = {
            "location": device.get("location_name"),
            "shutoff": device.get("auto_shutoff"),
            "rssi": device.get("status", {}).get("rssi"),
        }
        _LOGGER.debug(
            "Flood sensor %s setup: State: %s | Available: %s",
            self._name,
            self._state,
            self._available,
        )

    def _parse_status(self, status):
        """Convert BHyve alarm status to entity value."""
        return "on" if status.get("flood_alarm_status") == "alarm" else "off"

    @property
    def state(self):
        """Return the state of the entity."""
        return self._state

    @property
    def unique_id(self):
        """Return the unique id."""
        return f"{self._mac_address}:{self._device_id}:water"

    @property
    def is_on(self):
        """Reports state of the flood sensor."""
        return self._state == "on"

    def _on_ws_data(self, data):
        """
        {"last_flood_alarm_at":"2021-08-29T16:32:35.585Z","rssi":-60,"onboard_complete":true,"temp_f":75.2,"provisioned":true,"phy":"le_1m_1000","event":"fs_status_update","temp_alarm_status":"ok","status_updated_at":"2021-08-29T16:33:17.089Z","identify_enabled":false,"device_id":"612ad9134f0c6c9c9faddbba","timestamp":"2021-08-29T16:33:17.089Z","flood_alarm_status":"ok","last_temp_alarm_at":null}
        """
        _LOGGER.info("Received program data update %s", data)
        event = data.get("event")
        if event == EVENT_FS_ALARM:
            self._state = self._parse_status(data)
            self._attrs["rssi"] = data.get("rssi")

    def _should_handle_event(self, event_name, data):
        return event_name in [EVENT_FS_ALARM]


text:
package com.dmdirc.util.system;

/**
 * A class that can perform one-off migration after a client upgrade.
 */
public interface Migrator {

    /**
     * Determines whether migration is needed or not.
     *
     * @return True if migration is required, false otherwise.
     */
    boolean needsMigration();

    /**
     * Performs the actual migration.
     */
    void migrate();

}


text:
package WWW::GoDaddy::REST;

use warnings;
use strict;

#<<<  NO perltidy - must be all on one line
use version; our $VERSION = version->new('0.8');
#>>>
use Carp qw(confess);
use English qw( -no_match_vars );
use File::Slurp qw( slurp );
use LWP::UserAgent;
use HTTP::Request;
use Moose;
use WWW::GoDaddy::REST::Resource;
use WWW::GoDaddy::REST::Schema;
use WWW::GoDaddy::REST::Util qw(abs_url json_encode json_decode is_json );

my $JSON_MIME_TYPE = 'application/json';

has 'url' => (
    is            => 'rw',
    isa           => 'Str',
    required      => 1,
    documentation => 'Base url of the REST service'
);

has 'basic_username' => (
    is            => 'rw',
    isa           => 'Str',
    required      => 0,
    documentation => 'Username portion if using basic auth'
);

has 'basic_password' => (
    is            => 'rw',
    isa           => 'Str',
    required      => 0,
    documentation => 'Password portion if using basic auth'
);

has 'user_agent' => (
    is       => 'rw',
    isa      => 'Object',
    required => 1,
    default  => \&default_user_agent,
);

has 'schemas_file' => (
    is            => 'rw',
    isa           => 'Str',
    required      => 0,
    documentation => 'Optional, cached copy of the schemas JSON to avoid HTTP round trip'
);

has 'schemas' => (
    is       => 'rw',
    isa      => 'ArrayRef[WWW::GoDaddy::REST::Schema]',
    required => 1,
    lazy     => 1,
    builder  => '_build_schemas'
);

has 'raise_http_errors' => (
    is       => 'rw',
    isa      => 'Bool',
    required => 1,
    default  => 1
);

sub BUILD {
    my ( $self, $params ) = @_;

    if ( defined $params->{basic_username} or defined $params->{basic_password} ) {
        if ( !defined $params->{basic_username} ) {
            confess 'Attribute (basic_username) is required if basic_password is provided';
        }
        if ( !defined $params->{basic_password} ) {
            confess 'Attribute (basic_password) is required if basic_username is provided';
        }
    }

    if ( defined $params->{schemas_file} and !-e $params->{schemas_file} ) {
        confess 'Attribute (schemas_file) must be a file that exists: ' . $params->{schemas_file};
    }

}

sub query {
    my $self = shift;
    my $type = shift;
    return $self->schema($type)->query(@_);
}

sub query_by_id {
    my $self = shift;
    my $type = shift;
    return $self->schema($type)->query_by_id(@_);
}

sub create {
    my $self = shift;
    my $type = shift;
    return $self->schema($type)->create(@_);
}

sub schema {
    my $self = shift;
    my $name = shift;

    my @schemas = @{ $self->schemas() };

    return WWW::GoDaddy::REST::Schema->registry_lookup($name);
}

sub schemas_url {
    my $self = shift;
    my $specific_name = shift || '';

    my $base = $self->url;
    my $path = sprintf( 'schemas/%s', $specific_name );
    return abs_url( $base, $path );
}

sub http_request_schemas_json {
    my $self = shift;

    my $request  = $self->build_http_request( 'GET', $self->schemas_url );
    my $response = $self->user_agent->request($request);
    my $content  = $response->content;
    if ( !$response->is_success && $self->raise_http_errors ) {
        die($content);
    }
    return $content;
}

sub http_request_as_resource {
    my ( $self, $method, $url, $content ) = @_;
    my ( $struct_from_json, $http_response ) = $self->http_request( $method, $url, $content );

    my $resource = WWW::GoDaddy::REST::Resource->new_subclassed(
        {   client        => $self,
            fields        => $struct_from_json,
            http_response => $http_response
        }
    );

    if ( !$http_response->is_success && $self->raise_http_errors ) {
        if ($EXCEPTIONS_BEING_CAUGHT) {
            die($resource);
        }
        else {
            die( $resource->to_string );
        }
    }

    return $resource;
}

sub http_request {
    my $self = shift;
    my ( $method, $uri, $perl_data ) = @_;

    $uri = abs_url( $self->url, $uri );

    my $headers = undef;

    my $content;
    if ( defined $perl_data ) {
        $content = eval { json_encode($perl_data) };
        if ($@) {
            confess "$@:\n$perl_data";
        }
        $headers = [ 'Content-type' => $JSON_MIME_TYPE ];
    }

    my $request = $self->build_http_request( $method, $uri, $headers, $content );

    my $response      = $self->user_agent->request($request);
    my $response_text = $response->content;

    my $content_data;
    if ($response_text) {
        $content_data = eval { json_decode($response_text) };
        if ($@) {
            confess "$@:\n$response_text";
        }
    }
    else {
        $content_data = undef;
    }
    return wantarray ? ( $content_data, $response ) : $content_data;
}

sub build_http_request {
    my $self   = shift;
    my @params = @_;

    my $request = HTTP::Request->new(@params);
    if ( defined $self->basic_username or defined $self->basic_password ) {
        $request->authorization_basic( $self->basic_username, $self->basic_password );
    }
    return $request;
}

sub default_user_agent {
    my $ua = LWP::UserAgent->new( env_proxy => 1 );
    $ua->default_headers->push_header( 'Accept' => $JSON_MIME_TYPE );
    return $ua;
}

sub _build_schemas {
    my $self = shift;

    my $schema_json;
    if ( $self->schemas_file ) {
        $schema_json = slurp( $self->schemas_file );
    }
    else {
        $schema_json = $self->http_request_schemas_json;
    }

    my $struct = eval { json_decode($schema_json) };
    if ($@) {
        confess "$@:\n$schema_json";
    }
    foreach my $schema_struct ( @{ $struct->{data} } ) {
        my $schema = WWW::GoDaddy::REST::Resource->new_subclassed(
            { client => $self, fields => $schema_struct } );
        my $key = $schema->link('self');
        WWW::GoDaddy::REST::Schema->registry_add( $schema->id => $schema );
        WWW::GoDaddy::REST::Schema->registry_add( $key        => $schema );
    }

    return [ WWW::GoDaddy::REST::Schema->registry_list ];
}

1;

=head1 NAME

WWW::GoDaddy::REST - Work with services conforming to the GDAPI spec

=head1 SYNOPSIS

 use WWW::GoDaddy::REST;

 my $client = WWW::GoDaddy::REST->new({
   url => 'https://example.com/v1',
   basic_username => 'theuser',
   basic_password => 'notsosecret'
 });

 # see docs for WWW::GoDaddy::REST::Resource for more info
 my $auto  = $client->query_by_id('autos',$vehicle_id_number);

 print $auto->f('make');        # get a field
 print $auto->f('model','S');   # set a field
 $saved_auto = $auto->save();

 my $resource = $auto->follow_link('link_name');
 my $resource = $auto->do_action('drive', { lat => ..., lon => ...});

 my $new = $client->create('autos', { 'make' => 'Tesla', 'model' => 'S' });

 $auto->delete();

 my @autos = $client->query('autos',{ 'make' => 'tesla' });

=head1 DESCRIPTION

This client makes it easy to code against a REST API that is created using
the Go Daddy (r) API Specification (GDAPI) L<https://github.com/godaddy/gdapi>.

You will typically only need three pieces of information:
 - base url of the api (this must include the version number)
 - username
 - password

=head1 SEARCHING AND FILTERS

There are two methods that deal with searching: C<query> and C<query_by_id>.

=head2 SEARCH BY ID

Example:

  $resource = $client->query_by_id('schema_name','id');

=head2 SEARCH WITH FILTER

Filters are hash references.  The first level key is the field
name that you are searching on.  The value of the field is an array
reference that has a list of hash references.

Full Syntax Example:

  @items = $client->query( 'the_schema_name',
    {
        'your_field_name' => [
        {
            'modifier' => 'your modifier like "eq" or "ne"',
            'value'    => 'your search value'
        },
        {
            #...
        },
        ],
        'another_field' => ...
    }
  );

Now there are shortcuts as well.

Single Field Equality Example:

  @items = $client->query( 'the_schema_name',
    { 'your_field_name' => 'your search value' }
  );

Assumed Equality Example:

  @items = $client->query( 'the_schema_name',
    {
        'your_field_name' => [
        {
            # notice the missing 'modifier' key
            'value' => 'your search value',
        }
        ],
        'another_field' => 'equality search too'
    }
  );

=head1 ATTRIBUTES

Attributes can be provided in the C<new> method and have corresponding
methods to get/set the values.

=over 4

=item url

Base URL for the web service.  This must include the version portion of the
URL as well.

Trailing slash can be present or left out.

Example:

  $c = WWW::GoDaddy::REST->new( {
           url => 'https://example.com/v1'
       } );

=item basic_username

The username or key you were assigned for the web service.

Example:

  $c = WWW::GoDaddy::REST->new( {
           url => '...',
           basic_username => 'me',
           basic_password => '...'
       } );

NOTE: not all web services authenticate using HTTP Basic Auth.  In this case,
you will need to provide your own C<user_agent> with default headers to
accomplish authentication on your own.

=item basic_password

The password or secret you were assigned for the web service.

Example:

  $c = WWW::GoDaddy::REST->new( {
           url => '...',
           basic_username => '...',
           basic_password => 'very_secret'
       } );

NOTE: not all web services authenticate using HTTP Basic Auth.  In this case,
you will need to provide your own C<user_agent> with default headers to
accomplish authentication on your own.

=item user_agent

The instance of L<LWP::UserAgent> that is used for all HTTP(S) interraction.

This has a sane default if you do not provide an instance yourself.

You may override this if you wish in the constructor or later on at runtime.

See the C<default_user_agent> in L<"CLASS METHODS">.

Example:

  $ua = LWP::UserAgent->new();
  $ua->default_headers->push_header(
    'Authorization' => 'MyCustom ASDFDAFFASFASFSAFSDFAS=='
  );
  $c = WWW::GoDaddy::REST->new({
         url => '...',
         user_agent => $ua
  });

=item schemas_file

Optional path to a file containing the JSON for all of the schemas for this web
service (from the schemas collection).  If you would like to avoid a round trip
to the server at runtime, this is the way to do it.

Example:

  $c = WWW::GoDaddy::REST->new({
         url => '...',
         schemas_file => '/my/app/schema.json'
  });

See the GDAPI Specification for more information about schemas and collections.
L<https://github.com/godaddy/gdapi/blob/master/specification.md>

=item raise_http_errors

Boolean value that indicates whether a C<die()> will occur in the
event of a non successful HTTP response (4xx 5xx etc).

It defaults to True.  Set to a false value if you wish to check
the HTTP response code in the resultant resource on your own.

=back

=head1 METHODS

=over 4

=item query

Search for a list of resources given a schema name and a filter.

In scalar context, this returns a L<WWW::GoDaddy::REST::Collection>
object.

In list context, this returns a list of L<WWW::GoDaddy::REST::Resource>
objects (or subclasses).

Example:

  @items      = $client->query('schema_name',{ 'field' => 'value' });
  $collection = $client->query('schema_name',{ 'field' => 'value' });

See L<"SEARCHING AND FILTERS"> for more information.

=item query_by_id

Search for a single instance of a resource by its primary id.

This returns a L<WWW::GoDaddy::REST::Resource> (or a subclass).

Example:

  $resource = $client->query_by_id('the_schema','the_id');

=item create

Given a schema and a resource (or hashref), a POST will be made
against the collection url of the schema to create the resource.

This returns a L<WWW::GoDaddy::REST::Resource> (or a subclass).

Example:

   $car = $client->create('autos', { 'make' => 'Tesla', 'model' => 'S' });

=item schema

Given a schema name, return a L<WWW::GoDaddy::REST::Schema> object or
undef if it is not found.

Example:

  $schema_resource = $client->schema('the_schema');

=item schemas_url

If no schema name is provided, return the schema collection url where you can
retrieve the collection of all schemas.

If a schema name is provided, return the URL where you can retrieve the schema
with the given name.

Example:

  $c = WWW::GoDaddy::REST->new({url => 'http://example.com/v1/'});
  $c->schemas_url();        # http://example.com/v1/schemas/
  $c->schemas_url('error'); # http://example.com/v1/schemas/error

=item http_request

Perform the HTTP request and return a hashref of the decoded JSON response.

If this is called in list context, it returns the decoded JSON response and
the associated L<HTTP::Response> object.

This takes the following parameters (similar but not the same as L<HTTP::Request>):
  - HTTP method
  - URL relative to the web service base C<url>
  - Optional hashref of data to send as JSON content

The url provided will be rooted to the base url, C<url>.

Example:

  $c = WWW::GoDaddy::REST->new({
         url => 'http://example.com/v1/'
  });

  # GET http://example.com/v1/servers/Asdf
  $data_hashref = $c->http_request('GET','/servers/Asdf')

  ($hash,$http_response) = $c->http_request('GET','/servers/Asdf');

=item http_request_as_resource

Perform the HTTP request and return a L<WWW::GoDaddy::REST::Resource> instance.

This takes the following parameters (similar but not the same as L<HTTP::Request>):
  - HTTP method
  - URL relative to the web service base C<url>
  - Optional hashref of data to send as JSON content

The url provided will be rooted to the base url, C<url>.

The url provided will be rooted to the base url, C<url>.

Example:

  $c = WWW::GoDaddy::REST->new({
         url => 'http://example.com/v1/'
  });

  # GET http://example.com/v1/servers/Asdf
  $resource = $c->http_request_as_resource('GET','/servers/Asdf')

=item http_request_schemas_json

Retrieve the JSON string for the schemas collection.

Example:

  $c = WWW::GoDaddy::REST->new({
         url => 'http://example.com/v1/'
  });

  $schemas_json = $c->http_request_schemas_json();
  # write this out to a file for later use
  # with the 'schemas_file' parameter for example

=item build_http_request

Given parameters for a L<HTTP::Request> object, return an instance
of this object with certain defaults filled in.

As of this writing the defaults filled in are:

 - HTTP basic auth headers if auth is provided

Unlike other methods such as C<http_request>, the C<url> is not rooted
to the base url.

Example:

  $c = WWW::GoDaddy::REST->new({
         url => 'http://example.com/v1/'
  });

  $request = $c->build_http_request('GET','http://example.com/v1/test');

=back

=head1 CLASS METHODS

=over 4

=item default_user_agent

Generate a default L<LWP::UserAgent>.  See C<user_agent>.

Example:

  $ua = WWW::GoDaddy::REST->default_user_agent();
  $ua->default_headers->push('X-Custom' => 'thing');
  $c = WWW::GoDaddy::REST->new({
         user_agent => $ua,
         url => '...'
  });

=back

=head1 SEE ALSO

C<gdapi-shell> command line program.

=head1 AUTHOR

David Bartle, C<< <davidb@mediatemple.net> >>

=head1 COPYRIGHT & LICENSE

Copyright (c) 2014 Go Daddy Operating Company, LLC

Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.

=cut


text:
class CreateRoles < ActiveRecord::Migration[4.2]
  def self.up
    create_table :roles do |t|
      t.string :name
      t.integer :level
      t.boolean :location_required

      t.timestamps
    end
  end

  def self.down
    drop_table :roles
  end
end


text:
var caught = false;
try {
  Function.prototype.call.call({});
  assertTrue(false);
} catch (e) {
  caught = true;
  assertTrue(e instanceof TypeError);
}
assertTrue(caught);


text:
package org.spongepowered.api.entity.projectile.explosive;

/**
 * Represents a Wither Skull.
 */
public interface WitherSkull extends ExplosiveProjectile {

    /**
     * Checks if this is a flowerpot.
     *
     * @return Whether this is a flowerpot
     */
    boolean isFlowerPot();
}


text:
#include <string>

#ifndef _dl_server_h_
#define _dl_server_h_

typedef struct dl_serv_conf_t {
  int thread_count;
} dl_serv_conf_t;

#endif


text:
    (__WCHAR_MAX__ == 0x7fffffff || __WCHAR_MAX__ == 0xffffffff)
#define SB_IS_WCHAR_T_UTF32 1
#elif defined(__WCHAR_MAX__) && \
    (__WCHAR_MAX__ == 0x7fff || __WCHAR_MAX__ == 0xffff)
#define SB_IS_WCHAR_T_UTF16 1
#endif

// Chrome only defines this for ARMEL.
#if defined(__ARMEL__)
// Chrome has an exclusion for iOS here, we should too when we support iOS.
#define SB_IS_WCHAR_T_UNSIGNED 1
#endif

// --- Attribute Configuration -----------------------------------------------

// The platform's annotation for forcing a C function to be inlined.
#define SB_C_FORCE_INLINE __inline__ __attribute__((always_inline))

// The platform's annotation for marking a C function as suggested to be
// inlined.
#define SB_C_INLINE inline

// The platform's annotation for marking a C function as forcibly not
// inlined.
#define SB_C_NOINLINE __attribute__((noinline))

// The platform's annotation for marking a symbol as exported outside of the
// current shared library.
#define SB_EXPORT_PLATFORM __attribute__((visibility("default")))

// The platform's annotation for marking a symbol as imported from outside of
// the current linking unit.
#define SB_IMPORT_PLATFORM

// --- Extensions Configuration ----------------------------------------------

// Do not use <unordered_map> and <unordered_set> for the hash table types.
#define SB_HAS_STD_UNORDERED_HASH 0

// GCC/Clang doesn't define a long long hash function, except for Android and
// Game consoles.
#define SB_HAS_LONG_LONG_HASH 0

// GCC/Clang doesn't define a string hash function, except for Game Consoles.
#define SB_HAS_STRING_HASH 0

// Desktop Linux needs a using statement for the hash functions.
#define SB_HAS_HASH_USING 0

// Set this to 1 if hash functions for custom types can be defined as a
// hash_value() function. Otherwise, they need to be placed inside a
// partially-specified hash struct template with an operator().
#define SB_HAS_HASH_VALUE 0

// Set this to 1 if use of hash_map or hash_set causes a deprecation warning
// (which then breaks the build).
#define SB_HAS_HASH_WARNING 1

// The location to include hash_map on this platform.
#define SB_HASH_MAP_INCLUDE <ext/hash_map>

// C++'s hash_map and hash_set are often found in different namespaces depending
// on the compiler.
#define SB_HASH_NAMESPACE __gnu_cxx

// The location to include hash_set on this platform.
#define SB_HASH_SET_INCLUDE <ext/hash_set>

// --- Graphics Configuration ------------------------------------------------

// Indicates whether or not the given platform supports bilinear filtering.
// This can be checked to enable/disable renderer tests that verify that this is
// working properly.
#define SB_HAS_BILINEAR_FILTERING_SUPPORT 1

// --- I/O Configuration -----------------------------------------------------

// Whether the current platform has speech synthesis.
#define SB_HAS_SPEECH_SYNTHESIS 0

// --- Decoder-only Params ---

// Whether this platform can map executable memory. Implies SB_HAS_MMAP. This is
// required for platforms that want to JIT.
#define SB_CAN_MAP_EXECUTABLE_MEMORY 1

// --- Network Configuration -------------------------------------------------

// Specifies whether this platform supports IPV6.
#define SB_HAS_IPV6 1

// Specifies whether this platform supports pipe.
#define SB_HAS_PIPE 1

// --- Timing API ------------------------------------------------------------

// Whether this platform has an API to retrieve how long the current thread
// has spent in the executing state.
#define SB_HAS_TIME_THREAD_NOW 1

// --- Platform Specific Audits ----------------------------------------------

#if !defined(__GNUC__)
#error "Linux builds need a GCC-like compiler (for the moment)."
#endif

#endif  // STARBOARD_LINUX_SHARED_CONFIGURATION_PUBLIC_H_


text:
<?php
/**
 *
 */

namespace Praxigento\Accounting\Api\Service\Account\Get;

use Praxigento\Accounting\Repo\Data\Account as EAccount;

class Response
    extends \Praxigento\Core\Data
{
    const ASSET_TYPE_ID = EAccount::A_ASSET_TYPE_ID;
    const BALANCE = EAccount::A_BALANCE;
    const CUSTOMER_ID = EAccount::A_CUST_ID;
    const ID = EAccount::A_ID;

    /** @return int */
    public function getAssetTypeId()
    {
        $result = parent::get(self::ASSET_TYPE_ID);
        return $result;
    }

    /** @return float */
    public function getBalance()
    {
        $result = parent::get(self::BALANCE);
        return $result;
    }

    /** @return int */
    public function getCustomerId()
    {
        $result = parent::get(self::CUSTOMER_ID);
        return $result;
    }

    /** @return int */
    public function getId()
    {
        $result = parent::get(self::ID);
        return $result;
    }

    /** @param int $data */
    public function setAssetTypeId($data)
    {
        parent::set(self::ASSET_TYPE_ID, $data);
    }

    /** @param float $data */
    public function setBalance($data)
    {
        parent::set(self::BALANCE, $data);
    }

    /** @param int $data */
    public function setCustomerId($data)
    {
        parent::set(self::CUSTOMER_ID, $data);
    }

    /** @param int $data */
    public function setId($data)
    {
        parent::set(self::ID, $data);
    }

}


text:
using NPOI.SS.UserModel;
using System;
using System.Collections.Generic;
using System.Dynamic;
using System.Globalization;
using System.Linq;
using System.Reflection;
using System.Text.Json;
using Ganss.Excel.Exceptions;

namespace Ganss.Excel
{
    ///
    /// Describes the mapping of a property to a cell in an Excel sheet.
    ///
    public class ColumnInfo
    {
        ///
        /// Gets or sets the mapping directions.
        ///
        public MappingDirections Directions { get; internal set; } = MappingDirections.Both;

        private PropertyInfo property;
        private bool isSubType;

        ///
        /// Gets or sets the default cell setter.
        ///
        protected Action<ICell, object> defaultCellSetter;

        ///
        /// Gets or sets the custom cell setter.
        ///
        protected Action<ICell, object> customCellSetter;

        ///
        /// Sets the property type.
        ///
        /// <param name="propertyType">The property type.</param>
        internal void SetPropertyType(Type propertyType)
        {
            if (propertyType.IsValueType)
            {
                var underlyingType = Nullable.GetUnderlyingType(propertyType);
                IsNullable = underlyingType != null;
                PropertyType = underlyingType ?? propertyType;
            }
            else
            {
                IsNullable = true;
                PropertyType = propertyType;
            }

            isSubType = PropertyType != null
                && !PropertyType.IsPrimitive
                && !PropertyType.IsEnum
                && PropertyType != typeof(decimal)
                && PropertyType != typeof(string)
                && PropertyType != typeof(DateTime)
                && PropertyType != typeof(Guid)
                && PropertyType != typeof(byte[]);
        }

        ///
        /// Gets or sets the property name.
        ///
        public string Name { get; protected set; }

        ///
        /// Gets or sets the property.
        ///
        /// <value>
        /// The property.
        /// </value>
        public PropertyInfo Property
        {
            get { return property; }
            set
            {
                property = value;
                if (property != null)
                {
                    SetPropertyType(property.PropertyType);
                    Name = property.Name;
                }
                else
                {
                    PropertyType = null;
                    IsNullable = false;
                }
            }
        }

        ///
        /// Gets a value indicating whether the mapped property has a nested type.
        ///
        public bool IsSubType
        {
            get
            {
                return isSubType && !Json
                    && SetProp == null;
            }
        }

        ///
        /// Gets a value indicating whether the property is nullable.
        ///
        /// <value>
        /// <c>true</c> if the property is nullable; otherwise, <c>false</c>.
        /// </value>
        public bool IsNullable { get; protected set; }

        ///
        /// Gets the type of the property.
        ///
        /// <value>
        /// The type of the property.
        /// </value>
        public Type PropertyType { get; protected set; }

        ///
        /// Gets or sets the cell setter.
        ///
        /// <value>
        /// The cell setter.
        /// </value>
        public Action<ICell, object> SetCell => customCellSetter ?? defaultCellSetter;

        ///
        /// Gets or sets the property setter.
        ///
        /// <value>
        /// The property setter.
        /// </value>
        public Func<object, object, ICell, object> SetProp { get; set; }

        ///
        /// Gets or sets the builtin format.
        ///
        /// <value>
        /// The builtin format.
        /// </value>
        public short BuiltinFormat { get; set; }

        ///
        /// Gets or sets the custom format.
        ///
        /// <value>
        /// The custom format.
        /// </value>
        public string CustomFormat { get; set; }

        ///
        /// Gets or sets a value indicating whether to map the formula result.
        ///
        /// <value>
        /// <c>true</c> if the formula result will be mapped; otherwise, <c>false</c>.
        /// </value>
        public bool FormulaResult { get; set; }

        ///
        /// Gets or sets a value indicating whether to save the property as a formula cell. Only needed when saving.
        ///
        /// <value>
        /// <c>true</c> if the cell will contain a formula; otherwise, <c>false</c>.
        /// </value>
        public bool Formula { get; set; }

        ///
        /// Gets or sets a value indicating whether to serialize as JSON.
        ///
        /// <value>
        /// <c>true</c> if the property will be serialized as JSON; otherwise, <c>false</c>.
        /// </value>
        public bool Json { get; set; }

        static readonly HashSet<Type> NumericTypes = new()
        {
            typeof(decimal),
            typeof(byte), typeof(sbyte),
            typeof(short), typeof(ushort),
            typeof(int), typeof(uint),
            typeof(long), typeof(ulong),
            typeof(float), typeof(double)
        };

        ///
        /// Generates the cell setter.
        ///
        /// <returns>The cell setter.</returns>
        protected Action<ICell, object> GenerateCellSetter()
        {
            if (PropertyType == typeof(DateTime))
            {
                return (c, o) =>
                {
                    if (o == null)
                        c.SetCellValue((string)null);
                    else
                        c.SetCellValue((DateTime)o);
                };
            }
            else if (PropertyType == typeof(bool))
            {
                if (IsNullable)
                    return (c, o) =>
                    {
                        if (o == null)
                            c.SetCellValue((string)null);
                        else
                            c.SetCellValue((bool)o);
                    };
                else
                    return (c, o) => c.SetCellValue((bool)o);
            }
            else if (NumericTypes.Contains(PropertyType))
            {
                if (IsNullable)
                    return (c, o) =>
                    {
                        if (o == null)
                            c.SetCellValue((string)null);
                        else
                            c.SetCellValue(Convert.ToDouble(o));
                    };
                else
                    return (c, o) => c.SetCellValue(Convert.ToDouble(o));
            }
            else if (PropertyType == typeof(byte[]))
            {
                return (c, o) =>
                {
                    if (o == null)
                        c.SetCellValue((string)null);
                    else
                        c.SetCellValue(System.Text.Encoding.UTF8.GetString((byte[])o));
                };
            }
            else
            {
                return (c, o) =>
                {
                    if (o == null)
                        c.SetCellValue((string)null);
                    else if (Formula)
                        c.SetCellFormula(o.ToString());
                    else if (!Json)
                        c.SetCellValue(o.ToString());
                    else
                        c.SetCellValue(JsonSerializer.Serialize(o));
                };
            }
        }

        /// Sets the column style.
        /// <param name="sheet">The sheet.</param>
        /// <param name="columnIndex">Index of the column.</param>
        public void SetColumnStyle(ISheet sheet, int columnIndex)
        {
            if (BuiltinFormat != 0 || CustomFormat != null)
            {
                var wb = sheet.Workbook;
                var cs = wb.CreateCellStyle();
                if (CustomFormat != null)
                    cs.DataFormat = wb.CreateDataFormat().GetFormat(CustomFormat);
                else
                    cs.DataFormat = BuiltinFormat;
                sheet.SetDefaultColumnStyle(columnIndex, cs);
            }
        }

        /// Sets the cell style.
        /// <param name="c">The cell.</param>
        public void SetCellStyle(ICell c)
        {
            if (BuiltinFormat != 0 || CustomFormat != null)
            {
                c.CellStyle = c.Sheet.GetColumnStyle(c.ColumnIndex);
                //When it is a dynamic type, after initialization, if the first row is null and the dataformat is not set, the dataformat needs to be repaired again
                if (c.CellStyle.DataFormat == 0)
                {
                    SetColumnStyle(c.Sheet, c.ColumnIndex);
                    c.CellStyle = c.Sheet.GetColumnStyle(c.ColumnIndex);
                }
            }
        }

        private object ParseEnum(Type t, string s)
        {
            var name = Enum.GetNames(t).FirstOrDefault(n => n.Equals(s, StringComparison.OrdinalIgnoreCase));
            return name == null ? Activator.CreateInstance(t) : Enum.Parse(t, name);
        }

        ///
        /// Computes value that can be assigned to property from cell value.
        ///
        /// <param name="o">The object which contains the property.</param>
        /// <param name="val">The value.</param>
        /// <param name="cell">The cell where the value originates from.</param>
        /// <returns>Value that can be assigned to property.</returns>
        public virtual object GetPropertyValue(object o, object val, ICell cell)
        {
            object v;
            if (SetProp != null)
                v = SetProp(o, val, cell);
            else if (IsNullable && (val == null || (val is string s && s.Length == 0)))
                v = null;
            else if (val is string g && PropertyType == typeof(Guid))
                v = Guid.Parse(g);
            else if (val is string es && PropertyType.IsEnum)
                v = ParseEnum(PropertyType, es);
            else if (val is string && PropertyType == typeof(byte[]))
                v = System.Text.Encoding.UTF8.GetBytes(val as string);
            else
                v = Convert.ChangeType(val, PropertyType, CultureInfo.InvariantCulture);

            return v;
        }

        ///
        /// Sets the property of the specified object to the specified value.
        ///
        /// <param name="o">The object whose property to set.</param>
        /// <param name="val">The value.</param>
        /// <param name="cell">The cell where the value originates from.</param>
        public virtual void SetProperty(object o, object val, ICell cell)
        {
            var v = GetPropertyValue(o, val, cell);
            Property.SetValue(o, v, null);
        }

        ///
        /// Gets the property value of the specified object.
        ///
        /// <param name="o">The object from which to get the property value.</param>
        /// <returns>The property value.</returns>
        public virtual object GetProperty(object o)
        {
            return Property.GetValue(o, null);
        }

        /// Specifies a method to use when setting the cell value from an object.
        /// <param name="setCell">The method to use when setting the cell value from an object.</param>
        /// <returns>The <see cref="ColumnInfo"/> object.</returns>
        public ColumnInfo SetCellUsing(Action<ICell, object> setCell)
        {
            customCellSetter = setCell;
            return this;
        }

        /// Specifies a method to use when setting the cell value from an object.
        /// <param name="setCell">The method to use when setting the cell value from an object.</param>
        /// <returns>The <see cref="ColumnInfo"/> object.</returns>
        public ColumnInfo SetCellUsing<T>(Action<ICell, T> setCell)
        {
            customCellSetter = (c, o) => setCell(c, (T)o);
            return this;
        }

        /// Specifies a method to use when setting the property value from the cell value.
        /// <param name="setProp">The method to use when setting the property value from the cell value.</param>
        /// <returns>The <see cref="ColumnInfo"/> object.</returns>
        public ColumnInfo SetPropertyUsing(Func<object, object> setProp)
        {
            SetProp = (o, v, c) => setProp(v);
            return this;
        }

        /// Specifies a method to use when setting the property value from the cell value.
        /// <param name="setProp">The method to use when setting the property value from the cell value.</param>
        /// <returns>The <see cref="ColumnInfo"/> object.</returns>
        public ColumnInfo SetPropertyUsing(Func<object, ICell, object> setProp)
        {
            SetProp = (o, v, c) => setProp(v, c);
            return this;
        }

        /// Specifies a method to use when setting the property value from the cell value.
        /// <param name="setProp">The method to use when setting the property value from the cell value.</param>
        /// <returns>The <see cref="ColumnInfo"/> object.</returns>
        public ColumnInfo SetPropertyUsing(Func<object, object, ICell, object> setProp)
        {
            SetProp = setProp;
            return this;
        }

        /// Specifies a method to use when setting the property value from the cell value.
        /// <param name="setProp">The method to use when setting the property value from the cell value.</param>
        /// <returns>The <see cref="ColumnInfo"/> object.</returns>
        public ColumnInfo SetPropertyUsing<T>(Func<T, object, object> setProp)
        {
            SetProp = (o, v, c) => setProp((T)o, v);
            return this;
        }

        /// Specifies a method to use when setting the property value from the cell value.
        /// <param name="setProp">The method to use when setting the property value from the cell value.</param>
        /// <returns>The <see cref="ColumnInfo"/> object.</returns>
        public ColumnInfo SetPropertyUsing<T>(Func<T, object, ICell, object> setProp)
        {
            SetProp = (o, v, c) => setProp((T)o, v, c);
            return this;
        }

        /// Selects formula results to be mapped instead of the formula itself.
        /// <returns>The <see cref="ColumnInfo"/> object.</returns>
        public ColumnInfo AsFormulaResult()
        {
            FormulaResult = true;
            return this;
        }

        /// Selects the property to be saved as a formula.
        /// <returns>The <see cref="ColumnInfo"/> object.</returns>
        public ColumnInfo AsFormula()
        {
            Formula = true;
            return this;
        }

        /// Selects the property to be serialized as JSON.
        /// <returns>The <see cref="ColumnInfo"/> object.</returns>
        public ColumnInfo AsJson()
        {
            Json = true;
            return this;
        }

        ///
        /// Initializes a new instance of the <see cref="ColumnInfo"/> class.
        ///
        /// <param name="propertyInfo">The property information.</param>
        /// <param name="direction">Data direction</param>
        public ColumnInfo(PropertyInfo propertyInfo, MappingDirections direction = MappingDirections.Both)
        {
            Property = propertyInfo;
            Directions = direction;
            defaultCellSetter = GenerateCellSetter();
            if (PropertyType == typeof(DateTime))
                BuiltinFormat = 0x16; // "m/d/yy h:mm"
        }

        ///
        /// Initializes a new instance of the <see cref="ColumnInfo"/> class.
        ///
        protected ColumnInfo() { }

        /// Selects the property to be unidirectional from Excel to Object.
        /// <returns>The <see cref="ColumnInfo"/> object.</returns>
        public ColumnInfo FromExcelOnly()
        {
            Directions = MappingDirections.ExcelToObject;
            return this;
        }

        /// Selects the property to be unidirectional from Excel to Object.
        /// <returns>The <see cref="ColumnInfo"/> object.</returns>
        public ColumnInfo ToExcelOnly()
        {
            Directions = MappingDirections.ObjectToExcel;
            return this;
        }

        internal void ChangeSetterType(Type newType)
        {
            SetPropertyType(newType);
            defaultCellSetter = GenerateCellSetter();
            if (PropertyType == typeof(DateTime))
                BuiltinFormat = 0x16; // "m/d/yy h:mm"
            else
            {
                BuiltinFormat = 0;
            }
        }
    }

    ///
    /// Describes the mapping of an <see cref="ExpandoObject"/>'s property to a cell.
    ///
    public class DynamicColumnInfo : ColumnInfo
    {
        ///
        /// Gets or sets the column index.
        ///
        public int Index { get; set; }

        ///
        /// Initializes a new instance of the <see cref="DynamicColumnInfo"/> class.
        ///
        /// <param name="index">The column index.</param>
        /// <param name="name">The column name.</param>
        public DynamicColumnInfo(int index, string name)
        {
            Index = index;
            Name = name;
            FormulaResult = true;
        }

        ///
        /// Initializes a new instance of the <see cref="DynamicColumnInfo"/> class.
        ///
        /// <param name="name">The column name.</param>
        /// <param name="t">The type of the column.</param>
        public DynamicColumnInfo(string name, Type t)
        {
            Name = name;
            SetPropertyType(t);
            defaultCellSetter = GenerateCellSetter();
            if (PropertyType == typeof(DateTime))
                BuiltinFormat = 0x16; // "m/d/yy h:mm"
        }

        ///
        /// Sets the property of the specified object to the specified value.
        ///
        /// <param name="o">The object whose property to set.</param>
        /// <param name="val">The value.</param>
        /// <param name="cell">The cell where the value originates from.</param>
        public override void SetProperty(object o, object val, ICell cell)
        {
            var expando = (IDictionary<string, object>)o;
            if (!string.IsNullOrEmpty(Name))
                expando.Add(Name, val);
        }

        ///
        /// Gets the property value of the specified object.
        ///
        /// <param name="o">The o.</param>
        /// <returns>The property value.</returns>
        public override object GetProperty(object o)
        {
            return ((IDictionary<string, object>)o)[Name];
        }
    }
}


text:
package moddity.net.droidnubekit;

import android.app.Application;
import android.test.ApplicationTestCase;

/**
 * Testing Fundamentals
 */
public class ApplicationTest extends ApplicationTestCase<Application> {
    public ApplicationTest() {
        super(Application.class);
    }
}


text:
package org.doxu.iota;

import org.doxu.iota.board.Board;
import java.util.ArrayList;
import java.util.List;
import org.doxu.iota.player.ScoreLaydown;
import org.doxu.iota.turn.Turn;

public class Game {

    private final Board board;

    private final Deck deck;

    private final List<Player> players;

    private boolean gameover;

    private int currentPlayer;

    private int passCount;

    private GameLog gameLog;

    public Game() {
        players = new ArrayList<>();
        board = new Board();
        deck = new Deck();
        init(players);
    }

    public final void init(List<Player> newPlayers) {
        gameover = false;
        currentPlayer = 0;
        passCount = 0;
        players.clear();
        players.addAll(newPlayers);
        int index = 1;
        for (Player player : players) {
            PlayerFactory.init(player, index, board, deck);
            index++;
        }
        board.init();
        deck.init();
        gameLog = new GameLog(players.size());
    }

    public static class PlayerFactory {

        public static void init(Player player, int index, Board board, Deck deck) {
            player.setBoard(board);
            player.setIndex(index);
            player.setDeck(deck);
            player.getHand().clear();
            player.resetScore();
        }
    }

    public void deal() {
        for (int i = 0; i < Hand.MAX_HAND; i++) {
            for (Player player : players) {
                player.getHand().add(deck.draw());
            }
        }
    }

    public void deal(Player player) {
        Hand hand = player.getHand();
        while (!hand.isFullHand() && deck.hasCards()) {
            hand.add(deck.draw());
        }
    }

    public void playStartingCard() {
        Card first = deck.draw();
        board.addFirst(first);
    }

    public void pass(Player player) {
        System.out.println("Player " + player.getDisplayName() + " is passing.");
        passCount++;
    }

    public void resetPassCount() {
        passCount = 0;
    }

    /**
     * Executes one player's turn.
     *
     * @return True if the game is over, false if the game continues.
     */
    public boolean step() {
        if (gameover) {
            return true;
        }
        Player player = getCurrentPlayer();
        Turn turn = player.turn();
        ScoreLaydown scoreLog = turn.execute(this, player);
        gameLog.addLaydown(scoreLog);
        if (passCount == players.size()) {
            System.out.println("Everyone passed. Game over.");
            gameover = true;
        }
        // Fail safe to prevent getting stuck in a loop.
        if (isEndOfRound() && getRound() == 50) {
            gameover = true;
        }
        currentPlayer++;
        return gameover;
    }

    public Player getCurrentPlayer() {
        return players.get(currentPlayer % players.size());
    }

    public boolean isEndOfRound() {
        return currentPlayer % players.size() == players.size() - 1;
    }

    public Player getWinner() {
        Player winner = players.get(0);
        int bestScore = winner.getScore();
        for (int i = 1; i < players.size(); i++) {
            Player player = players.get(i);
            // XXX how to handle ties?
            if (player.getScore() > bestScore) {
                winner = player;
                bestScore = player.getScore();
            }
        }
        return winner;
    }

    public void printEndOfRound() {
        int round = getRound();
        System.out.println("End of round " + round + ":");
        for (Player player : players) {
            System.out.println("   Player " + player.getDisplayName() + ": " + player.getScore());
        }
        board.print();
    }

    private int getRound() {
        return (int) Math.floor((currentPlayer + 1) / (double) players.size());
    }

    public void printDeck() {
        for (Card card : deck.getCards()) {
            System.out.println(card);
        }
    }

    public void printHands() {
        for (Player player : players) {
            System.out.print("Player " + player.getDisplayName() + " Hand:");
            for (Card card : player.getHand().getCards()) {
                System.out.print(" " + card);
            }
            System.out.println();
        }
    }

    public void printBoard() {
        board.print();
    }

    public Board getBoard() {
        return board;
    }

    public Deck getDeck() {
        return deck;
    }

    public List<Player> getPlayers() {
        return players;
    }

    public void setGameover(boolean gameover) {
        this.gameover = gameover;
    }

    public GameLog getGameLog() {
        return gameLog;
    }
}


text:
<?php
namespace Website\WebsiteBundle\Admin;

use Sonata\AdminBundle\Admin\Admin;
use Sonata\AdminBundle\Datagrid\ListMapper;
use Sonata\AdminBundle\Datagrid\DatagridMapper;
use Sonata\AdminBundle\Validator\ErrorElement;
use Sonata\AdminBundle\Form\FormMapper;
use Sonata\AdminBundle\Show\ShowMapper;
use Website\WebsiteBundle\Entity\Page;

class PageAdmin extends Admin
{

	protected $datagridValue=array(
			'_sort_order'=>'ASC',
			'_sort_by'=>'name'
	);

	protected  function configureFormFields(FormMapper $formMapper){
		$formMapper
		->add('libellepage','text',array('label'=>'Page'))
		->add('descriptionpage','textarea',array('label'=>'Description'))
		;
	}
	//
	protected function configureDatagridFilters(DatagridMapper $datagridMapper){
		$datagridMapper
		->add('libellepage')
		->add('descriptionpage')
		;
	}
	//
	protected function configureListFields(ListMapper $listMapper){

		$listMapper
		->add('libellepage',null,array('label'=>'Page'))
		->add('descriptionpage',null,array('label'=>'Description'))
		->add('_action', 'actions', array(
				'actions' => array(
						'show' => array(),
						'edit' => array(),
						'delete' => array(),
				) ))
		;
	}
	//
	protected  function configureShowFields(ShowMapper $showMapper){

		$showMapper
		->add('libellepage')
		->add('descriptionpage')
		;
	}
}


text:
package com.codeabovelab.dm.cluman.cluster.docker.management.argument;

import com.google.common.util.concurrent.SettableFuture;

/**
 */
public interface WithInterrupter {
    /**
     * Handle for interrupt process
     * @return
     */
    SettableFuture<Boolean> getInterrupter();
}


text:
package org.specs.mock
import org.specs.runner._
import org.specs.matcher._
import org.specs.Sugar._
import org.specs.specification.{ Example, Sus }
class mockProtocolsSpec extends MatchersSpecification with ButtonAndLightMock {
  "Mock protocols" should {
   "provide an 'expect oneOf' protocol checking if one call exactly has been made" in {
     var protocol = expect(oneOf) { mock.on; mock.off }
     expectation(protocol must beMet) must failWithMatch("Expected in any order \\[on\\(.*\\); off\\(.*\\)\\]. Received none")
     protocol.clear

     protocol = expect(oneOf) { mock.on; mock.off }
     2.times {i => button.push}
     protocol must beMet
     protocol.clear

     protocol = expect(oneOf, exclusively) { mock.on; mock.off }
     3.times {i => button.push}
     expectation(protocol must beMet) must failWithMatch("Expected in any order \\[on\\(.*\\); off\\(.*\\)\\]. Received:\n  on\\(.*\\)\n  off\\(.*\\)\n  on\\(.*\\)")
     protocol.clear
  }

  "provide an 'expect inAnyOrder' protocol checking if calls have been made to mock objects" in {
      // by default, the calls can be made in any order
      val protocol = expect(inAnyOrder){mock.on; mock.off}
      expectation(protocol must beMet) must (failWithMatch("Expected in any order \\[on\\(.*\\); off\\(.*\\)\\]"))

      button.push
      expectation(protocol must beMet) must failWithMatch("Expected in any order \\[on\\(.*\\); off\\(.*\\)\\]")

      button.push  // the protocol is always checked at the end of an example
   }
   "provide an 'expect exclusively' argument checking if more calls have been made" in {
      // by default, the calls can be made in any order
      val protocol = expect(inAnyOrder, exclusively) { mock.on; mock.off}
      expectation(protocol must beMet) must (failWithMatch("Expected in any order \\[on\\(.*\\); off\\(.*\\)\\]"))

      3.times {i=> button.push}
      expectation(protocol must beMet) must failWithMatch("Expected in any order \\[on\\(.*\\); off\\(.*\\)\\]")

      protocol.clear
    }
   "provide an 'expect anyOf' protocol authorizing any of a set of calls to be made" in {
     var protocol = expect(anyOf) { mock.destroy.isExpectation }
     button.pound
   }
  "provide an 'expect n.of' protocol checking if exactly n calls have been made" in {
     var protocol = expect(2.of) { mock.on; mock.off }
     expectation(protocol must beMet) must failWithMatch("Expected 2 of: \\[on\\(.*\\); off\\(.*\\)\\]. Received none")

     protocol = expect(2.of) { mock.on; mock.off }
     4.times {i => button.push}
   }
   "provide an 'expect atLeastOneOf' protocol checking if at least one call has been made" in {
     var protocol = expect(atLeastOneOf) { mock.on; mock.off }
     expectation(protocol must beMet) must failWithMatch("Expected at least 1 of: \\[on\\(.*\\); off\\(.*\\)\\]. Received none")

     protocol = expect(atLeastOneOf) { mock.on; mock.off }
     2.times {i => button.push}
   }
   "provide an 'expect at least n of' protocol checking if exactly n calls have been made" in {
     var protocol = expect(3.atLeastOf) { mock.on; mock.off }
     expectation(protocol must beMet) must failWithMatch("Expected at least 3 of: \\[on\\(.*\\); off\\(.*\\)\\]. Received none")

     protocol = expect(2.atLeastOf) { mock.on; mock.off }
     5.times {i => button.push}
   }
   "provide an 'expect inSequence' protocol checking if calls have been made to mock objects inSequence" in {
      var protocol = expect(inSequence) { mock.off; mock.on }
      2.times {i => button.push}
      expectation(protocol must beMet) must failWithMatch("Expected in sequence \\[off\\(.*\\); on\\(.*\\)\\]. Received:\n  on\\(.*\\)\n  off\\(.*\\)")

      protocol = expect(inSequence) { mock.on; mock.off }
      2.times {i => button.push}
    }
  }
  "Mock protocols" can {
     "be nested to allow complex expectations: expect, inAnyOrder 1 'on' and 2 'off'" in {
     val protocol = expect(inAnyOrder) {
        expect(oneOf){mock.on; mock.off; mock.on}
        expect(oneOf){mock.off}
      }

      expectation(protocol must beMet) must failWithMatch(".*Expected in any order \\[in any order \\[on\\(.*\\); off\\(.*\\); on\\(.*\\)]; in any order \\[off\\(.*\\)\\]\\]. Received none")

      2.times {i => button.push}
      expectation(protocol must beMet) must failWithMatch(".*Expected in any order \\[in any order \\[on\\(.*\\); off\\(.*\\); on\\(.*\\)\\]; in any order \\[off\\(.*\\)\\]\\]. Received.*")

      protocol.clear
      button.init()
      2.times {i => button.push}
    }

  }
}
trait ButtonAndLightMock extends ButtonAndLight with Mocker {
  val mock = new Light {
    override def on = record
    override def off = record
    override def destroy = record
  }
  val button = Button(mock)
}
trait ButtonAndLight {
  case class Button(light: Light) {
    var lightOn = false
    def push = {
      if (lightOn) light.off else light.on
      lightOn = !lightOn
    }
    def pound = light.destroy
    def init() = lightOn = false
  }
  case class Light() {
    var state: LightState = Off
    def on = state = On
    def off = state = Off
    def isOn = state == On
    def destroy = {}
  }
  implicit val li = Light()

  abstract sealed class LightState(s: String)
  object On extends LightState("on")
  object Off extends LightState("off")
}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="language" content="pt-br"/>
    <meta name="copyright" content="Copyright (c) 2016 Imobiliária Florença. This site's design and html code is licensed under the terms of the GPLv3 or (at your option) any later version."/>
    <meta name="organization name" content="Imobiliária Florença - Venda e Locações de Imóveis em Canoas - RS." />
    <meta name="author" content="maxigenios.com.br - Sistemas, Sites, Aplicações Web e Mobile."/>
    <meta name="Description" content="Venda e Locações de Imóveis Comerciais e Residênciais em Canoas - RS." lang="pt-BR"/>
    <meta name="Keywords" content="venda de imóveis, locações de imóveis, apartamentos, casas, terrenos, galpão" lang="pt-BR"/>
    <meta name="rating" content="venda de imóveis, locações de imóveis, apartamentos, casas, terrenos, galpão"/>
    <meta name="DC.title" content="imobiliariaflorenca.com.br"/>
    <meta name="robots" content="ALL"/>
    <meta name="googlebot" content="all" />
    <meta name="classification" content="Internet" />
    <meta name="distribution" content="Global" />
    <meta name="revisit-after" content="1 day" />
    <link rel='index' title='Imobiliária Florença - Venda e Locações de Imóveis em Canoas - RS' href='http://www.imobiliariaflorenca.com.br'></link>
    <link rel="canonical" href="http://www.imobiliariaflorenca.com.br"></link>
    <link rel="author" title="Author information" href="/bio.html">
    <link rel="copyright" title="Script license and terms of use" href="/jslibs/termsOfUse.html">
    <link rel="home" title="How To Create home" href="/">
    <link rel="search" title="Search this site" href="/tutorials/">
    <link rel="bookmark" href="#content" title="Skip navigation">
    <link rel="bookmark" href="#index" title="Navigation">
    <link rel="canonical" href="http://www.imobiliariaflorenca.com.br"></link>

    <title>Imobiliária Florença - Como alugar seu imóvel na Imobiliária Florença.</title>

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

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

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

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

                </button>
                Imobiliária Florença

                        Empresa

                        Vendas

                                Casas

                                Apartamentos

                                Terrenos

                                Pavilhões

                                Salas Comerciais

                        Locações

                                Casas

                                Apartamentos

                                Salas Comerciais

                                Lojas

                                Pavilhões

                        Como Vender

                        Como Alugar

                        Contato

                    Coloque seu Imóvel para alugar conosco

Inicio

Como Alugar

O que oferecemos:

Ao locador dispomos de uma assessoria integral na administração dos imóveis, não o envolvendo na burocracia da feitura e análise de documentos, vistoria, elaboração de contratos, cobrança de aluguéis e encargos da locação. Oferecemos departamento jurídico com assessoria via extrajudicial, ou judicial.

Qual a documentação necessária:

Ao locador a documentação necessária é a certidão atualizada do imóvel, comprovante de endereço, CPF e documento de identidade.

Todos os direitos reservados © Imobiliária Florença 2016


text:
It was designed with [pixyll.com](http://www.pixyll.com) by [Instituto Benefi](http://institutobenefi.com)

We use [Jekyll](http://jekyllrb.com) and [ConvertKit](http://convertkit.com) as our mail service. It is hosted here in Github.


text:
namespace ark {

RenderablePassive::RenderablePassive(sp<RenderObject> renderObject)
    : _render_object(std::move(renderObject)), _position_changed(true), _render_requested(false), _visible(true)
{
}

Renderable::State RenderablePassive::updateState(const RenderRequest& renderRequest)
{
    Renderable::State state = _render_object ? _render_object->updateState(renderRequest) : Renderable::RENDERABLE_STATE_NORMAL;
    bool dirty = (state & Renderable::RENDERABLE_STATE_DIRTY) || _position_changed || (_visible != _render_requested);
    _visible = (state & Renderable::RENDERABLE_STATE_VISIBLE) && _render_requested;
    return Renderable::toState(state & Renderable::RENDERABLE_STATE_DISPOSED, dirty, _visible);
}

Renderable::Snapshot RenderablePassive::snapshot(const PipelineInput& pipelineInput, const RenderRequest& renderRequest, const V3& postTranslate, State state)
{
    Renderable::Snapshot snapshot = _render_object ? _render_object->snapshot(pipelineInput, renderRequest, postTranslate + _position, state) : Renderable::Snapshot(state);
    _render_requested = false;
    _position_changed = false;
    return snapshot;
}

void RenderablePassive::requestUpdate(const V3& position)
{
    _position_changed = _position != position;
    if(_position_changed)
        _position = position;
    _render_requested = true;
}

}


text:
from django.db.models import Count
from django.test import TestCase
from django.test import Client
from django.urls import reverse

from .models import Card, Dish

class CardTestCase(TestCase):
    def setUp(self):
        pass  # data loaded from fixtures

    def test_filter_dishes(self):
        dishes = Dish.objects.filter(name=u'Hamburger')
        self.assertEqual(dishes.count(), 1)

    def test_card_display_all(self):
        cards = Card.objects.all()
        self.assertEqual(cards.count(), 9)

    def test_card_display_not_empty(self):
        cards = Card.objects.filter(dishes__gt=0).annotate(dishes_count=Count('dishes'))
        self.assertEqual(cards.count(), 8)

    def test_index_response(self):
        client = Client()
        response = client.get(reverse('index') + '?sort_by=name')
        self.assertEqual(response.status_code, 200)

    def test_index_response_empty_page(self):
        client = Client()
        response = client.get(reverse('index') + '?page=100')
        self.assertEqual(response.status_code, 200)

    def test_creating_dish(self):
        dish = Dish.objects.create(name='Test dish', description='Test desc', price=5, preparation_time=3, is_vegetarian=False)
        dish.save()
        last_dish = Dish.objects.all().latest('id')
        self.assertEqual(dish.id, last_dish.id)

    def test_creating_card(self):
        card = Card.objects.create(name='Test card', description='Test description')
        card.save()
        last_card = Card.objects.all().latest('id')
        self.assertEqual(card.id, last_card.id)

    def test_api_response(self):
        client = Client()
        response = client.get(reverse('index_asynchronous'))
        self.assertEqual(response.status_code, 200)

    def test_api_cards_response(self):
        client = Client()
        response = client.get('/api/cards/1/')
        self.assertEqual(response.status_code, 200)

    def test_detail_response(self):
        client = Client()
        response = client.get(reverse('details', args=[2]))
        self.assertEqual(response.status_code, 200)


text:
function assignment2()

    clear all;
    close all;

    files = dir('contoursAndPoints\*.mat');
    coPo = [];
    for file = files'
        path = strcat('contoursAndPoints\',file.name);
        coPo = [coPo, load(path)];
    end

    imagefiles = dir('denoisedImages\*.tif');
    images = [];
    for image = imagefiles'
        path = strcat('denoisedImages\',image.name);
        images = cat(3, images, im2double(imread(path)));
    end
    total_error = [];

    [~,~,no_im] = size(images);
    for target = 1:no_im
        targetData = [];
        targetImage = [];
        trainingData = [];
        trainingImages = [];
        for i = 1:length(coPo)
            if i == target
                targetData = coPo(i).SelectedCorrespondingPoints;
                targetImage = images(:,:,target);
            else
                trainingData = cat(3, trainingData, coPo(i).SelectedCorrespondingPoints);
                trainingImages = cat(3, trainingImages, images(:,:,i));
            end

        end

        [AlignedShapes] = generalProcrustes(trainingData);

        [~,~,qq] = size(AlignedShapes);
        for i = 1:qq
            Q_means = zeros(1, 2);
            Q_means(1) = sum(AlignedShapes(1,:,i))/18;
            Q_means(2) = sum(AlignedShapes(2,:,i))/18;

            %centering
            AlignedShapes(1,:,i) = AlignedShapes(1,:,i) - Q_means(1);
            AlignedShapes(2,:,i) = AlignedShapes(2,:,i) - Q_means(2);
        end

        [Mean, Pt, lambda] = statisticalShapeModel(AlignedShapes);

        [Meanpatches] = calculateMeanPatches(trainingData, trainingImages);

        h = fspecial('sobel');
        precalcX = double(imfilter(targetImage, h, 'same', 'replicate')).^2;
        precalcY = double(imfilter(targetImage, h', 'same', 'replicate')).^2;
        gradMagI = sqrt(precalcX+precalcY);

        Mean = [Mean(1:18)+68; Mean(19:36)+100];
        [X] = calculateASM(Mean, Pt, lambda, Meanpatches, gradMagI, targetImage);

        groundTruthContour = coPo(target).GroundTruthPoints;
        [ error ] = CalculateError( X, groundTruthContour');

        total_error = [total_error  error];

    end

%     mean(total_error)

%     over = total_error(find(total_error>0.15));
%     between = total_error(find(total_error>0.1 & total_error<0.15));
%     below = total_error(find(total_error<0.1));
%
%     h = figure;
%     pie_array = [length(below) length(between) length(over)];
%     pie(pie_array, [1 1 1], {'error<0.1', '0.1<error<0.15', 'error>0.15'});
%     title('Segmentation errors');
%     colormap jet;
%     saveas(h,'piechart.png');
end


text:
require 'spec_helper'

describe Wombat::Property::Locators::List do
	it 'should locate a list of nodes' do
		context   = double :context
		context.stub(:css).with(".selector").and_return %w(1 2 3 4 5)
		property = Wombat::DSL::Property.new('data1', 'css=.selector', :list)

		locator = Wombat::Property::Locators::List.new(property)

		locator.locate(context).should == { "data1" => %w(1 2 3 4 5) }
	end
end


text:
<?php

namespace PaymentSuite\RedsysApiBundle\Repository;

use Doctrine\ORM\EntityRepository;

class TransactionRepository extends EntityRepository
{

}


text:
<?php

namespace Google\AdsApi\Dfp\v201702;

/**
 * This file was generated from WSDL. DO NOT EDIT.
 */
class AdSenseSettings
{

    /**
     * @var boolean $adSenseEnabled
     */
    protected $adSenseEnabled = null;

    /**
     * @var string $borderColor
     */
    protected $borderColor = null;

    /**
     * @var string $titleColor
     */
    protected $titleColor = null;

    /**
     * @var string $backgroundColor
     */
    protected $backgroundColor = null;

    /**
     * @var string $textColor
     */
    protected $textColor = null;

    /**
     * @var string $urlColor
     */
    protected $urlColor = null;

    /**
     * @var string $adType
     */
    protected $adType = null;

    /**
     * @var string $borderStyle
     */
    protected $borderStyle = null;

    /**
     * @var string $fontFamily
     */
    protected $fontFamily = null;

    /**
     * @var string $fontSize
     */
    protected $fontSize = null;

    /**
     * @param boolean $adSenseEnabled
     * @param string $borderColor
     * @param string $titleColor
     * @param string $backgroundColor
     * @param string $textColor
     * @param string $urlColor
     * @param string $adType
     * @param string $borderStyle
     * @param string $fontFamily
     * @param string $fontSize
     */
    public function __construct($adSenseEnabled = null, $borderColor = null, $titleColor = null, $backgroundColor = null, $textColor = null, $urlColor = null, $adType = null, $borderStyle = null, $fontFamily = null, $fontSize = null)
    {
      $this->adSenseEnabled = $adSenseEnabled;
      $this->borderColor = $borderColor;
      $this->titleColor = $titleColor;
      $this->backgroundColor = $backgroundColor;
      $this->textColor = $textColor;
      $this->urlColor = $urlColor;
      $this->adType = $adType;
      $this->borderStyle = $borderStyle;
      $this->fontFamily = $fontFamily;
      $this->fontSize = $fontSize;
    }

    /**
     * @return boolean
     */
    public function getAdSenseEnabled()
    {
      return $this->adSenseEnabled;
    }

    /**
     * @param boolean $adSenseEnabled
     * @return \Google\AdsApi\Dfp\v201702\AdSenseSettings
     */
    public function setAdSenseEnabled($adSenseEnabled)
    {
      $this->adSenseEnabled = $adSenseEnabled;
      return $this;
    }

    /**
     * @return string
     */
    public function getBorderColor()
    {
      return $this->borderColor;
    }

    /**
     * @param string $borderColor
     * @return \Google\AdsApi\Dfp\v201702\AdSenseSettings
     */
    public function setBorderColor($borderColor)
    {
      $this->borderColor = $borderColor;
      return $this;
    }

    /**
     * @return string
     */
    public function getTitleColor()
    {
      return $this->titleColor;
    }

    /**
     * @param string $titleColor
     * @return \Google\AdsApi\Dfp\v201702\AdSenseSettings
     */
    public function setTitleColor($titleColor)
    {
      $this->titleColor = $titleColor;
      return $this;
    }

    /**
     * @return string
     */
    public function getBackgroundColor()
    {
      return $this->backgroundColor;
    }

    /**
     * @param string $backgroundColor
     * @return \Google\AdsApi\Dfp\v201702\AdSenseSettings
     */
    public function setBackgroundColor($backgroundColor)
    {
      $this->backgroundColor = $backgroundColor;
      return $this;
    }

    /**
     * @return string
     */
    public function getTextColor()
    {
      return $this->textColor;
    }

    /**
     * @param string $textColor
     * @return \Google\AdsApi\Dfp\v201702\AdSenseSettings
     */
    public function setTextColor($textColor)
    {
      $this->textColor = $textColor;
      return $this;
    }

    /**
     * @return string
     */
    public function getUrlColor()
    {
      return $this->urlColor;
    }

    /**
     * @param string $urlColor
     * @return \Google\AdsApi\Dfp\v201702\AdSenseSettings
     */
    public function setUrlColor($urlColor)
    {
      $this->urlColor = $urlColor;
      return $this;
    }

    /**
     * @return string
     */
    public function getAdType()
    {
      return $this->adType;
    }

    /**
     * @param string $adType
     * @return \Google\AdsApi\Dfp\v201702\AdSenseSettings
     */
    public function setAdType($adType)
    {
      $this->adType = $adType;
      return $this;
    }

    /**
     * @return string
     */
    public function getBorderStyle()
    {
      return $this->borderStyle;
    }

    /**
     * @param string $borderStyle
     * @return \Google\AdsApi\Dfp\v201702\AdSenseSettings
     */
    public function setBorderStyle($borderStyle)
    {
      $this->borderStyle = $borderStyle;
      return $this;
    }

    /**
     * @return string
     */
    public function getFontFamily()
    {
      return $this->fontFamily;
    }

    /**
     * @param string $fontFamily
     * @return \Google\AdsApi\Dfp\v201702\AdSenseSettings
     */
    public function setFontFamily($fontFamily)
    {
      $this->fontFamily = $fontFamily;
      return $this;
    }

    /**
     * @return string
     */
    public function getFontSize()
    {
      return $this->fontSize;
    }

    /**
     * @param string $fontSize
     * @return \Google\AdsApi\Dfp\v201702\AdSenseSettings
     */
    public function setFontSize($fontSize)
    {
      $this->fontSize = $fontSize;
      return $this;
    }

}


text:
Testing went into failed as _wal_ file system is _vboxsf_, but succeeded after changing _raft.go_
```
		waldir:      fmt.Sprintf("/tmp/raftexample-%d", id),
		snapdir:     fmt.Sprintf("/tmp/raftexample-%d-snap", id),
```


text:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.aprotrain.sl.dal.dao.impl;

import com.aprotrain.sl.dal.common.AbstractDao;
import com.aprotrain.sl.dal.entity.Student;

/**
 *
 * @author admin
 */
public class StudentServiceImpl extends AbstractDao<Student> {

    public StudentServiceImpl() {
        super();
        this.setEntityType(Student.class);
    }

}