text:
<?php

namespace IU\PHPCap;

use PHPUnit\Framework\TestCase;

use IU\PHPCap\RedCapProject;

/**
 * PHPUnit tests for users for the RedCapProject class.
 */
class UsersTest extends TestCase
{
    private static $config;
    private static $basicDemographyProject;
    private static $longitudinalDataProject;

    public static function setUpBeforeClass()
    {
        self::$config = parse_ini_file(__DIR__.'/../config.ini');
        self::$basicDemographyProject = new RedCapProject(
            self::$config['api.url'],
            self::$config['basic.demography.api.token']
        );
        self::$longitudinalDataProject = new RedCapProject(
            self::$config['api.url'],
            self::$config['longitudinal.data.api.token']
        );
    }

    public function testExportUsers()
    {
        # This should return at least the owner of the project
        $users = self::$basicDemographyProject->exportUsers();

        $this->assertNotNull($users, 'Non-null users check.');

        $this->assertEquals('array', gettype($users), 'Users type check.');
        $this->assertGreaterThan(0, count($users), 'At least one user check.');
        $this->assertEquals('array', gettype($users), 'Users type check.');

        $user1 = $users[0];

        $this->assertEquals('array', gettype($user1), 'User 1 type check.');
        $this->assertTrue(array_key_exists('username', $user1), 'Key username check.');
    }

    public function testImportUsers()
    {
        $newUserData = array(
            [
                'username'      => 'phpcap_import_test_user',
                'design'        => 1,
                'data_export'   => 1,
                'record_create' => 1
            ]
        );

        $numberImported = self::$basicDemographyProject->importUsers($newUserData);
        $this->assertEquals(1, $numberImported, 'Number imported check.');

        $users = self::$basicDemographyProject->exportUsers();

        $newUser = null;
        foreach ($users as $user) {
            if ($user['username'] === $newUserData[0]['username']) {
                $newUser = $user;
                break;
            }
        }

        $this->assertNotNull($newUser, 'New user found in export check.');
        $this->assertEquals($newUser['design'], 1, 'Design check 1.');
        $this->assertEquals($newUser['data_export'], 1, 'Data export check 1.');
        $this->assertEquals($newUser['record_create'], 1, 'Record create check 1.');

        #------------------------------------------------------
        # Re-import with permissions set to zero, and check
        #------------------------------------------------------
        $newUserData[0]['design']      = 0;
        $newUserData[0]['data_export'] = 0;
        $newUserData[0]['record_create'] = 0;

        $numberImported = self::$basicDemographyProject->importUsers($newUserData);
        $this->assertEquals(1, $numberImported, 'Number imported check.');

        $users = self::$basicDemographyProject->exportUsers();

        $newUser = null;
        foreach ($users as $user) {
            if ($user['username'] === $newUserData[0]['username']) {
                $newUser = $user;
                break;
            }
        }

        $this->assertNotNull($newUser, 'New user found in export check.');
        $this->assertEquals($newUser['design'], 0, 'Design check 2.');
        $this->assertEquals($newUser['data_export'], 0, 'Data export check 2.');
        $this->assertEquals($newUser['record_create'], 0, 'Record create check 2.');

        # There's no way (as of June 2017) to delete the user that was added.
    }
}


text:
package com.hp.application.automation.tools.rest;

/**
 *
 * @author Amir Zahavi
 *
 */
public interface HttpHeaders {

    public static final String PtaL = "PtAL";
    public static final String PvaL = "PvAL";
    public static final String CONTENT_TYPE = "Content-Type";
    public static final String SET_COOKIE = "Set-Cookie";
    public static final String ACCEPT = "Accept";
    public static final String AUTHORIZATION = "Authorization";
}

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0" encoding="utf-8" ?>
<config>
  <!-- Summarization entity -->
  <entity name="RevisionChangeFlagSummary">
    <property name="Changed" type="int"></property>
    <property name="TestCase" type="double"></property>
    <property name="Submission" type="double"></property>
  </entity>
</config>


text:
@echo off

pdflatex -interaction=batchmode -draftmode document.tex
bibtex document
pdflatex -interaction=batchmode -draftmode document.tex
pdflatex -interaction=batchmode -draftmode document.tex
pdflatex document.tex


text:
"""The tests for the litejet component."""
import logging

from homeassistant.components import light
from homeassistant.components.light import ATTR_BRIGHTNESS
from homeassistant.const import ATTR_ENTITY_ID, SERVICE_TURN_OFF, SERVICE_TURN_ON

from . import async_init_integration

_LOGGER = logging.getLogger(__name__)

ENTITY_LIGHT = "light.mock_load_1"
ENTITY_LIGHT_NUMBER = 1
ENTITY_OTHER_LIGHT = "light.mock_load_2"
ENTITY_OTHER_LIGHT_NUMBER = 2

async def test_on_brightness(hass, mock_litejet):
    """Test turning the light on with brightness."""
    await async_init_integration(hass)

    assert hass.states.get(ENTITY_LIGHT).state == "off"
    assert hass.states.get(ENTITY_OTHER_LIGHT).state == "off"

    assert not light.is_on(hass, ENTITY_LIGHT)

    await hass.services.async_call(
        light.DOMAIN,
        SERVICE_TURN_ON,
        {ATTR_ENTITY_ID: ENTITY_LIGHT, ATTR_BRIGHTNESS: 102},
        blocking=True,
    )
    mock_litejet.activate_load_at.assert_called_with(ENTITY_LIGHT_NUMBER, 39, 0)

async def test_on_off(hass, mock_litejet):
    """Test turning the light on and off."""
    await async_init_integration(hass)

    assert hass.states.get(ENTITY_LIGHT).state == "off"
    assert hass.states.get(ENTITY_OTHER_LIGHT).state == "off"

    assert not light.is_on(hass, ENTITY_LIGHT)

    await hass.services.async_call(
        light.DOMAIN,
        SERVICE_TURN_ON,
        {ATTR_ENTITY_ID: ENTITY_LIGHT},
        blocking=True,
    )
    mock_litejet.activate_load.assert_called_with(ENTITY_LIGHT_NUMBER)

    await hass.services.async_call(
        light.DOMAIN,
        SERVICE_TURN_OFF,
        {ATTR_ENTITY_ID: ENTITY_LIGHT},
        blocking=True,
    )
    mock_litejet.deactivate_load.assert_called_with(ENTITY_LIGHT_NUMBER)

async def test_activated_event(hass, mock_litejet):
    """Test handling an event from LiteJet."""

    await async_init_integration(hass)

    # Light 1
    mock_litejet.get_load_level.return_value = 99
    mock_litejet.get_load_level.reset_mock()
    mock_litejet.load_activated_callbacks[ENTITY_LIGHT_NUMBER]()
    await hass.async_block_till_done()

    mock_litejet.get_load_level.assert_called_once_with(ENTITY_LIGHT_NUMBER)

    assert light.is_on(hass, ENTITY_LIGHT)
    assert not light.is_on(hass, ENTITY_OTHER_LIGHT)
    assert hass.states.get(ENTITY_LIGHT).state == "on"
    assert hass.states.get(ENTITY_OTHER_LIGHT).state == "off"
    assert hass.states.get(ENTITY_LIGHT).attributes.get(ATTR_BRIGHTNESS) == 255

    # Light 2

    mock_litejet.get_load_level.return_value = 40
    mock_litejet.get_load_level.reset_mock()
    mock_litejet.load_activated_callbacks[ENTITY_OTHER_LIGHT_NUMBER]()
    await hass.async_block_till_done()

    mock_litejet.get_load_level.assert_called_once_with(ENTITY_OTHER_LIGHT_NUMBER)

    assert light.is_on(hass, ENTITY_LIGHT)
    assert light.is_on(hass, ENTITY_OTHER_LIGHT)
    assert hass.states.get(ENTITY_LIGHT).state == "on"
    assert hass.states.get(ENTITY_OTHER_LIGHT).state == "on"
    assert (
        int(hass.states.get(ENTITY_OTHER_LIGHT).attributes.get(ATTR_BRIGHTNESS)) == 103
    )

async def test_deactivated_event(hass, mock_litejet):
    """Test handling an event from LiteJet."""
    await async_init_integration(hass)

    # Initial state is on.
    mock_litejet.get_load_level.return_value = 99

    mock_litejet.load_activated_callbacks[ENTITY_OTHER_LIGHT_NUMBER]()
    await hass.async_block_till_done()

    assert light.is_on(hass, ENTITY_OTHER_LIGHT)

    # Event indicates it is off now.

    mock_litejet.get_load_level.reset_mock()
    mock_litejet.get_load_level.return_value = 0

    mock_litejet.load_deactivated_callbacks[ENTITY_OTHER_LIGHT_NUMBER]()
    await hass.async_block_till_done()

    # (Requesting the level is not strictly needed with a deactivated
    # event but the implementation happens to do it. This could be
    # changed to an assert_not_called in the future.)
    mock_litejet.get_load_level.assert_called_with(ENTITY_OTHER_LIGHT_NUMBER)

    assert not light.is_on(hass, ENTITY_OTHER_LIGHT)
    assert not light.is_on(hass, ENTITY_LIGHT)
    assert hass.states.get(ENTITY_LIGHT).state == "off"
    assert hass.states.get(ENTITY_OTHER_LIGHT).state == "off"


text:
(function(prattle){
  var Message = Backbone.Model.extend({
    initialize: function()
    {
      this.set("sent_at",Prattle.getFormattedDate());

      if(this.get('from').indexOf('@') > -1){
        this.set('from',this.get('from').split('@')[0]);
      }

    },
    defaults: {
            id: "message_id",
      friendly_name:'',
      from:"",
            to:"",
            client: "",
            context: "",
            source_user_type: "visitor",
            chat_uid: "",
            source_uid: "na",
            sent_at: "",
            source_username: 'Visitor',
            target_username: 'Agent',
            last_message_sent_at: '2012-08-01',
            text: ""
    },
    VISITOR_USER_TYPE:"visitor",
    CUSTOMER_USER_TYPE:"customer",
    SUPERVISOR_USER_TYPE:"supervisor"
  });
  prattle.Models.Message = Message;

})(Prattle);


text:
@implementation TSDKAvailability

@dynamic status, notes, notesAuthorMemberId, memberId, eventId, teamId, createdAt, updatedAt, linkEvent, linkMember, linkTeam;

+ (NSString *)SDKType {
    return @"availability";
}

+ (NSString *)SDKREL {
    return @"availabilities";
}

- (TSDKAvailabilityState)statusCode {
    NSInteger result = [super getInteger:@"status_code"];
    if (result == NSNotFound) {
        return TSDKAvailabilityStateIsUnknown;
    } else {
        return result;
    }
}

- (void)setStatusCode:(TSDKAvailabilityState)statusCode {
    [super setInteger:statusCode forKey:@"status_code"];
}

- (void)saveWithCompletion:(TSDKSaveCompletionBlock)completion {
    if ([self isNewObject]) {
        // In apiV3, availability objects are created for every new event for historical/compatibility reasons. In the case of a new availability for a new event, we should query the API for a matching availability object, copy the href/ID from the existing object into our object, and save it.
        NSString *eventId = self.eventId;
        NSString *memberId = self.memberId;
        NSString *teamId = self.teamId;
        if ((memberId == nil) || (eventId == nil) || (teamId == nil)) {
            completion(NO, self, [self availabilitySaveError:@"Information missing"]);
            return;
        }

        TSDKCollectionQuery *availabilitySearch = [TSDKAvailability queryForKey:@"search"];
        availabilitySearch.data = [@{@"member_id" : memberId,
                                    @"event_id" : eventId,
                                    @"team_id" : teamId
                                    } mutableCopy];

        [availabilitySearch executeWithCompletion:^(BOOL success, BOOL complete, TSDKCollectionJSON * _Nullable objects, NSError * _Nullable error) {
            TSDKAvailability *availability;
            if(success && ([[objects collection] isKindOfClass:[NSArray class]])) {
                NSArray *availabilities = [TSDKObjectsRequest SDKObjectsFromCollection:objects];
                if([[availabilities firstObject] isKindOfClass:[TSDKAvailability class]]) {
                    availability = (TSDKAvailability *)[availabilities firstObject];
                    [self setCollectionHref:availability.urlForSave];
                    [self setCollectionObject:availability.objectIdentifier forKey:@"id"];
                    [self saveWithCompletion:completion];
                } else {
                    completion(success, nil, [self availabilitySaveError:@"Event Availabilities Not Found"]);
                    return;
                }

            } else if(success == NO) {
                completion(success, nil, error);
                return;
            } else {
                completion(success, nil, [self availabilitySaveError:@"Event Availabilities Not Found"]);
                return;
            }
        }];
    } else {
        [super saveWithCompletion:completion];
    }
}

- (NSError *)availabilitySaveError:(NSString *)errorDescription {
    NSLog(@"* Availability Error %@", errorDescription);
    NSDictionary *userInfo = @{NSLocalizedFailureReasonErrorKey : errorDescription, NSLocalizedDescriptionKey : NSLocalizedString(errorDescription, errorDescription)};
    return [NSError errorWithDomain:TSDKTeamSnapSDKErrorDomainKey code:1 userInfo:userInfo];
}

@end


text:
from __future__ import absolute_import, division
import datetime

from astropy.time import Time
from astropy.coordinates.baseframe import TimeFrameAttribute

from sunpy.extern import six
from sunpy.time import parse_time

__all__ = ['TimeFrameAttributeSunPy']

class TimeFrameAttributeSunPy(TimeFrameAttribute):
    """
    Frame attribute descriptor for quantities that are Time objects.
    See the `~astropy.coordinates.FrameAttribute` API doc for further
    information.

    Parameters
    ----------
    default : object
        Default value for the attribute if not provided
    secondary_attribute : str
        Name of a secondary instance attribute which supplies the value
        if ``default`` is ``None`` and no value was supplied during initialization.

    Returns
    -------
    frame_attr : descriptor
        A new data descriptor to hold a frame attribute
    """
    def convert_input(self, value):
        """
        Convert input value to a Time object and validate by running through the
        Time constructor.  Also check that the input was a scalar.

        Parameters
        ----------
        value : object
            Input value to be converted.

        Returns
        -------
        out, converted : correctly-typed object, boolean
            Tuple consisting of the correctly-typed object and a boolean which
            indicates if conversion was actually performed.

        Raises
        ------
        ValueError
            If the input is not valid for this attribute.
        """
        if value is None:
            return None, False

        elif value == 'now':
            return Time(datetime.datetime.now()), True

        elif isinstance(value, Time):
            out = value
            converted = False

        elif isinstance(value, six.string_types):
            try:
                out = Time(parse_time(value))
            except Exception as err:
                raise ValueError('Invalid time input {0}={1!r}\n{2}'
                                 .format(self.name, value, err))
            converted = True
        else:
            try:
                out = Time(value)
            except Exception as err:
                raise ValueError('Invalid time input {0}={1!r}\n{2}'
                                 .format(self.name, value, err))
            converted = True

        if not out.isscalar:
            raise ValueError('Time input {0}={1!r} must be a single (scalar) value'
                             .format(self.name, value))

        return out, converted


text:
<img align="right" src="./docs/128_128.jpg">

**Setup** is a module of [AngryJupiter](https://github.com/isaacloud/angry-jupiter) - a console tool kit based on Node.js which allows for managing gamification instances in IsaaCloud.

Setup allows for sending an initial configuration for a gamification instance in IsaaCloud. Configuration may contain such elements as: achievements, scripts, leaderboards, and tags.

---

## Prerequisites

To install Setup, you need to have [AngryJupiter Core installed](https://github.com/isaacloud/angry-jupiter).

## Installation

To install Setup, run the following command in your console:

```
angry install setup
```

## Usage

1. [Optionally] Enter the directory with a prepared configuration for an instance

	```
	cd example_directory/
	```

2. Run AJ Setup

	```
	angry setup <configFile> [options]
	```

	where:

	- `<configFile>` is a required parameter that specifies file with setup configuration
	- `[options]` are optional ([see below](#options))

3. The module will create each element of the configuration for a desired instance.

## Options

You can run the module with the following options:

| Option 					        | Description										                                        |
|-----------------------------------|-------------------------------------------------------------------------------------------|
| `-h`, `--help` 				    | outputs information on how to use the application                                         |
| `-V`, `--version` 			    | outputs the version of the application                                                    |
| `-d`, `--details`				    | runs the application in the details mode                                                  |
| `--env <environment>`             | set config environment to use in setup                                                    |
| `--resource <resourceName>`       | set resource to setup (can use multiple times - ex. `--resource tags --resource tasks`)   |
| `--timeout <timeout>`			    | set each request timeout (in ms)	        		                                        |
| `--tries-number <triesNumber>`	| how many times request will be repeated if error occurs 			                        |

# Changelog

## 2.0.0
**13 September 2016**

* Added support for multiple resource urls (microservices such as pages, rankme)


text:
.class Lcom/actionbarsherlock/widget/ActivityChooserView$ActivityChooserViewAdapter;
.super Landroid/widget/BaseAdapter;
.source "ActivityChooserView.java"

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/actionbarsherlock/widget/ActivityChooserView;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x2
    name = "ActivityChooserViewAdapter"
.end annotation

# static fields
.field private static final ITEM_VIEW_TYPE_ACTIVITY:I = 0x0

.field private static final ITEM_VIEW_TYPE_COUNT:I = 0x3

.field private static final ITEM_VIEW_TYPE_FOOTER:I = 0x1

.field public static final MAX_ACTIVITY_COUNT_DEFAULT:I = 0x4

.field public static final MAX_ACTIVITY_COUNT_UNLIMITED:I = 0x7fffffff

# instance fields
.field private mDataModel:Lcom/actionbarsherlock/widget/ActivityChooserModel;

.field private mHighlightDefaultActivity:Z

.field private mMaxActivityCount:I

.field private mShowDefaultActivity:Z

.field private mShowFooterView:Z

.field final synthetic this$0:Lcom/actionbarsherlock/widget/ActivityChooserView;

# direct methods
.method private constructor <init>(Lcom/actionbarsherlock/widget/ActivityChooserView;)V
    .locals 1

    .prologue
    .line 638
    iput-object p1, p0, Lcom/actionbarsherlock/widget/ActivityChooserView$ActivityChooserViewAdapter;->this$0:Lcom/actionbarsherlock/widget/ActivityChooserView;

    invoke-direct {p0}, Landroid/widget/BaseAdapter;-><init>()V

    .line 652
    const/4 v0, 0x4

    iput v0, p0, Lcom/actionbarsherlock/widget/ActivityChooserView$ActivityChooserViewAdapter;->mMaxActivityCount:I

    .line 655
    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/actionbarsherlock/widget/ActivityChooserView$ActivityChooserViewAdapter;->mShowDefaultActivity:Z

    return-void
.end method

.method synthetic constructor <init>(Lcom/actionbarsherlock/widget/ActivityChooserView;Lcom/actionbarsherlock/widget/ActivityChooserView$1;)V
    .locals 0
    .param p1, "x0"    # Lcom/actionbarsherlock/widget/ActivityChooserView;
    .param p2, "x1"    # Lcom/actionbarsherlock/widget/ActivityChooserView$1;

    .prologue
    .line 638
    invoke-direct {p0, p1}, Lcom/actionbarsherlock/widget/ActivityChooserView$ActivityChooserViewAdapter;-><init>(Lcom/actionbarsherlock/widget/ActivityChooserView;)V

    return-void
.end method

# virtual methods
.method public getActivityCount()I
    .locals 1

    .prologue
    .line 810
    iget-object v0, p0, Lcom/actionbarsherlock/widget/ActivityChooserView$ActivityChooserViewAdapter;->mDataModel:Lcom/actionbarsherlock/widget/ActivityChooserModel;

    invoke-virtual {v0}, Lcom/actionbarsherlock/widget/ActivityChooserModel;->getActivityCount()I

    move-result v0

    return v0
.end method

.method public getCount()I
    .locals 3

    .prologue
    .line 696
    const/4 v1, 0x0

    .line 697
    .local v1, "count":I
    iget-object v2, p0, Lcom/actionbarsherlock/widget/ActivityChooserView$ActivityChooserViewAdapter;->mDataModel:Lcom/actionbarsherlock/widget/ActivityChooserModel;

    invoke-virtual {v2}, Lcom/actionbarsherlock/widget/ActivityChooserModel;->getActivityCount()I

    move-result v0

    .line 698
    .local v0, "activityCount":I
    iget-boolean v2, p0, Lcom/actionbarsherlock/widget/ActivityChooserView$ActivityChooserViewAdapter;->mShowDefaultActivity:Z

    if-nez v2, :cond_0

    iget-object v2, p0, Lcom/actionbarsherlock/widget/ActivityChooserView$ActivityChooserViewAdapter;->mDataModel:Lcom/actionbarsherlock/widget/ActivityChooserModel;

    invoke-virtual {v2}, Lcom/actionbarsherlock/widget/ActivityChooserModel;->getDefaultActivity()Landroid/content/pm/ResolveInfo;

    move-result-object v2

    if-eqz v2, :cond_0

    .line 699
    add-int/lit8 v0, v0, -0x1

    .line 701
    :cond_0
    iget v2, p0, Lcom/actionbarsherlock/widget/ActivityChooserView$ActivityChooserViewAdapter;->mMaxActivityCount:I

    invoke-static {v0, v2}, Ljava/lang/Math;->min(II)I

    move-result v1

    .line 702
    iget-boolean v2, p0, Lcom/actionbarsherlock/widget/ActivityChooserView$ActivityChooserViewAdapter;->mShowFooterView:Z

    if-eqz v2, :cond_1

    .line 703
    add-int/lit8 v1, v1, 0x1

    .line 705
    :cond_1
    return v1
.end method

.method public getDataModel()Lcom/actionbarsherlock/widget/ActivityChooserModel;
    .locals 1

    .prologue
    .line 822
    iget-object v0, p0, Lcom/actionbarsherlock/widget/ActivityChooserView$ActivityChooserViewAdapter;->mDataModel:Lcom/actionbarsherlock/widget/ActivityChooserModel;

    return-object v0
.end method

.method public getDefaultActivity()Landroid/content/pm/ResolveInfo;
    .locals 1

    .prologue
    .line 799
    iget-object v0, p0, Lcom/actionbarsherlock/widget/ActivityChooserView$ActivityChooserViewAdapter;->mDataModel:Lcom/actionbarsherlock/widget/ActivityChooserModel;

    invoke-virtual {v0}, Lcom/actionbarsherlock/widget/ActivityChooserModel;->getDefaultActivity()Landroid/content/pm/ResolveInfo;

    move-result-object v0

    return-object v0
.end method

.method public getHistorySize()I
    .locals 1

    .prologue
    .line 814
    iget-object v0, p0, Lcom/actionbarsherlock/widget/ActivityChooserView$ActivityChooserViewAdapter;->mDataModel:Lcom/actionbarsherlock/widget/ActivityChooserModel;

    invoke-virtual {v0}, Lcom/actionbarsherlock/widget/ActivityChooserModel;->getHistorySize()I

    move-result v0

    return v0
.end method

.method public getItem(I)Ljava/lang/Object;
    .locals 2
    .param p1, "position"    # I

    .prologue
    .line 709
    invoke-virtual {p0, p1}, Lcom/actionbarsherlock/widget/ActivityChooserView$ActivityChooserViewAdapter;->getItemViewType(I)I

    move-result v0

    .line 710
    .local v0, "itemViewType":I
    packed-switch v0, :pswitch_data_0

    .line 719
    new-instance v1, Ljava/lang/IllegalArgumentException;

    invoke-direct {v1}, Ljava/lang/IllegalArgumentException;-><init>()V

    throw v1

    .line 712
    :pswitch_0
    const/4 v1, 0x0

    .line 717
    :goto_0
    return-object v1

    .line 714
    :pswitch_1
    iget-boolean v1, p0, Lcom/actionbarsherlock/widget/ActivityChooserView$ActivityChooserViewAdapter;->mShowDefaultActivity:Z

    if-nez v1, :cond_0

    iget-object v1, p0, Lcom/actionbarsherlock/widget/ActivityChooserView$ActivityChooserViewAdapter;->mDataModel:Lcom/actionbarsherlock/widget/ActivityChooserModel;

    invoke-virtual {v1}, Lcom/actionbarsherlock/widget/ActivityChooserModel;->getDefaultActivity()Landroid/content/pm/ResolveInfo;

    move-result-object v1

    if-eqz v1, :cond_0

    .line 715
    add-int/lit8 p1, p1, 0x1

    .line 717
    :cond_0
    iget-object v1, p0, Lcom/actionbarsherlock/widget/ActivityChooserView$ActivityChooserViewAdapter;->mDataModel:Lcom/actionbarsherlock/widget/ActivityChooserModel;

    invoke-virtual {v1, p1}, Lcom/actionbarsherlock/widget/ActivityChooserModel;->getActivity(I)Landroid/content/pm/ResolveInfo;

    move-result-object v1

    goto :goto_0

    .line 710
    :pswitch_data_0
    .packed-switch 0x0
        :pswitch_1
        :pswitch_0
    .end packed-switch
.end method

.method public getItemId(I)J
    .locals 2
    .param p1, "position"    # I

    .prologue
    .line 724
    int-to-long v0, p1

    return-wide v0
.end method

.method public getItemViewType(I)I
    .locals 1
    .param p1, "position"    # I

    .prologue
    .line 683
    iget-boolean v0, p0, Lcom/actionbarsherlock/widget/ActivityChooserView$ActivityChooserViewAdapter;->mShowFooterView:Z

    if-eqz v0, :cond_0

    invoke-virtual {p0}, Lcom/actionbarsherlock/widget/ActivityChooserView$ActivityChooserViewAdapter;->getCount()I

    move-result v0

    add-int/lit8 v0, v0, -0x1

    if-ne p1, v0, :cond_0

    .line 684
    const/4 v0, 0x1

    .line 686
    :goto_0
    return v0

    :cond_0
    const/4 v0, 0x0

    goto :goto_0
.end method

.method public getMaxActivityCount()I
    .locals 1

    .prologue
    .line 818
    iget v0, p0, Lcom/actionbarsherlock/widget/ActivityChooserView$ActivityChooserViewAdapter;->mMaxActivityCount:I

    return v0
.end method

.method public getShowDefaultActivity()Z
    .locals 1

    .prologue
    .line 836
    iget-boolean v0, p0, Lcom/actionbarsherlock/widget/ActivityChooserView$ActivityChooserViewAdapter;->mShowDefaultActivity:Z

    return v0
.end method

.method public getView(ILandroid/view/View;Landroid/view/ViewGroup;)Landroid/view/View;
    .locals 10
    .param p1, "position"    # I
    .param p2, "convertView"    # Landroid/view/View;
    .param p3, "parent"    # Landroid/view/ViewGroup;

    .prologue
    const/4 v9, 0x1

    const/4 v8, 0x0

    .line 728
    invoke-virtual {p0, p1}, Lcom/actionbarsherlock/widget/ActivityChooserView$ActivityChooserViewAdapter;->getItemViewType(I)I

    move-result v3

    .line 729
    .local v3, "itemViewType":I
    packed-switch v3, :pswitch_data_0

    .line 763
    new-instance v6, Ljava/lang/IllegalArgumentException;

    invoke-direct {v6}, Ljava/lang/IllegalArgumentException;-><init>()V

    throw v6

    .line 731
    :pswitch_0
    if-eqz p2, :cond_0

    invoke-virtual {p2}, Landroid/view/View;->getId()I

    move-result v6

    if-eq v6, v9, :cond_1

    .line 732
    :cond_0
    iget-object v6, p0, Lcom/actionbarsherlock/widget/ActivityChooserView$ActivityChooserViewAdapter;->this$0:Lcom/actionbarsherlock/widget/ActivityChooserView;

    invoke-virtual {v6}, Lcom/actionbarsherlock/widget/ActivityChooserView;->getContext()Landroid/content/Context;

    move-result-object v6

    invoke-static {v6}, Landroid/view/LayoutInflater;->from(Landroid/content/Context;)Landroid/view/LayoutInflater;

    move-result-object v6

    sget v7, Lcom/actionbarsherlock/R$layout;->abs__activity_chooser_view_list_item:I

    invoke-virtual {v6, v7, p3, v8}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;Z)Landroid/view/View;

    move-result-object p2

    .line 734
    invoke-virtual {p2, v9}, Landroid/view/View;->setId(I)V

    .line 735
    sget v6, Lcom/actionbarsherlock/R$id;->abs__title:I

    invoke-virtual {p2, v6}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v5

    check-cast v5, Landroid/widget/TextView;

    .line 736
    .local v5, "titleView":Landroid/widget/TextView;
    iget-object v6, p0, Lcom/actionbarsherlock/widget/ActivityChooserView$ActivityChooserViewAdapter;->this$0:Lcom/actionbarsherlock/widget/ActivityChooserView;

    # getter for: Lcom/actionbarsherlock/widget/ActivityChooserView;->mContext:Landroid/content/Context;
    invoke-static {v6}, Lcom/actionbarsherlock/widget/ActivityChooserView;->access$700(Lcom/actionbarsherlock/widget/ActivityChooserView;)Landroid/content/Context;

    move-result-object v6

    sget v7, Lcom/actionbarsherlock/R$string;->abs__activity_chooser_view_see_all:I

    invoke-virtual {v6, v7}, Landroid/content/Context;->getString(I)Ljava/lang/String;

    move-result-object v6

    invoke-virtual {v5, v6}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .end local v5    # "titleView":Landroid/widget/TextView;
    :cond_1
    move-object v1, p2

    .line 761
    .end local p2    # "convertView":Landroid/view/View;
    .local v1, "convertView":Landroid/view/View;
    :goto_0
    return-object v1

    .line 741
    .end local v1    # "convertView":Landroid/view/View;
    .restart local p2    # "convertView":Landroid/view/View;
    :pswitch_1
    if-eqz p2, :cond_2

    invoke-virtual {p2}, Landroid/view/View;->getId()I

    move-result v6

    sget v7, Lcom/actionbarsherlock/R$id;->abs__list_item:I

    if-eq v6, v7, :cond_3

    .line 742
    :cond_2
    iget-object v6, p0, Lcom/actionbarsherlock/widget/ActivityChooserView$ActivityChooserViewAdapter;->this$0:Lcom/actionbarsherlock/widget/ActivityChooserView;

    invoke-virtual {v6}, Lcom/actionbarsherlock/widget/ActivityChooserView;->getContext()Landroid/content/Context;

    move-result-object v6

    invoke-static {v6}, Landroid/view/LayoutInflater;->from(Landroid/content/Context;)Landroid/view/LayoutInflater;

    move-result-object v6

    sget v7, Lcom/actionbarsherlock/R$layout;->abs__activity_chooser_view_list_item:I

    invoke-virtual {v6, v7, p3, v8}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;Z)Landroid/view/View;

    move-result-object p2

    .line 745
    :cond_3
    iget-object v6, p0, Lcom/actionbarsherlock/widget/ActivityChooserView$ActivityChooserViewAdapter;->this$0:Lcom/actionbarsherlock/widget/ActivityChooserView;

    # getter for: Lcom/actionbarsherlock/widget/ActivityChooserView;->mContext:Landroid/content/Context;
    invoke-static {v6}, Lcom/actionbarsherlock/widget/ActivityChooserView;->access$700(Lcom/actionbarsherlock/widget/ActivityChooserView;)Landroid/content/Context;

    move-result-object v6

    invoke-virtual {v6}, Landroid/content/Context;->getPackageManager()Landroid/content/pm/PackageManager;

    move-result-object v4

    .line 747
    .local v4, "packageManager":Landroid/content/pm/PackageManager;
    sget v6, Lcom/actionbarsherlock/R$id;->abs__icon:I

    invoke-virtual {p2, v6}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v2

    check-cast v2, Landroid/widget/ImageView;

    .line 748
    .local v2, "iconView":Landroid/widget/ImageView;
    invoke-virtual {p0, p1}, Lcom/actionbarsherlock/widget/ActivityChooserView$ActivityChooserViewAdapter;->getItem(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/content/pm/ResolveInfo;

    .line 749
    .local v0, "activity":Landroid/content/pm/ResolveInfo;
    invoke-virtual {v0, v4}, Landroid/content/pm/ResolveInfo;->loadIcon(Landroid/content/pm/PackageManager;)Landroid/graphics/drawable/Drawable;

    move-result-object v6

    invoke-virtual {v2, v6}, Landroid/widget/ImageView;->setImageDrawable(Landroid/graphics/drawable/Drawable;)V

    .line 751
    sget v6, Lcom/actionbarsherlock/R$id;->abs__title:I

    invoke-virtual {p2, v6}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v5

    check-cast v5, Landroid/widget/TextView;

    .line 752
    .restart local v5    # "titleView":Landroid/widget/TextView;
    invoke-virtual {v0, v4}, Landroid/content/pm/ResolveInfo;->loadLabel(Landroid/content/pm/PackageManager;)Ljava/lang/CharSequence;

    move-result-object v6

    invoke-virtual {v5, v6}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 753
    # getter for: Lcom/actionbarsherlock/widget/ActivityChooserView;->IS_HONEYCOMB:Z
    invoke-static {}, Lcom/actionbarsherlock/widget/ActivityChooserView;->access$1300()Z

    move-result v6

    if-eqz v6, :cond_4

    .line 755
    iget-boolean v6, p0, Lcom/actionbarsherlock/widget/ActivityChooserView$ActivityChooserViewAdapter;->mShowDefaultActivity:Z

    if-eqz v6, :cond_5

    if-nez p1, :cond_5

    iget-boolean v6, p0, Lcom/actionbarsherlock/widget/ActivityChooserView$ActivityChooserViewAdapter;->mHighlightDefaultActivity:Z

    if-eqz v6, :cond_5

    .line 756
    invoke-static {p2, v9}, Lcom/actionbarsherlock/widget/ActivityChooserView$SetActivated;->invoke(Landroid/view/View;Z)V

    :cond_4
    :goto_1
    move-object v1, p2

    .line 761
    .end local p2    # "convertView":Landroid/view/View;
    .restart local v1    # "convertView":Landroid/view/View;
    goto :goto_0

    .line 758
    .end local v1    # "convertView":Landroid/view/View;
    .restart local p2    # "convertView":Landroid/view/View;
    :cond_5
    invoke-static {p2, v8}, Lcom/actionbarsherlock/widget/ActivityChooserView$SetActivated;->invoke(Landroid/view/View;Z)V

    goto :goto_1

    .line 729
    :pswitch_data_0
    .packed-switch 0x0
        :pswitch_1
        :pswitch_0
    .end packed-switch
.end method

.method public getViewTypeCount()I
    .locals 1

    .prologue
    .line 692
    const/4 v0, 0x3

    return v0
.end method

.method public measureContentWidth()I
    .locals 9

    .prologue
    const/4 v8, 0x0

    .line 770
    iget v5, p0, Lcom/actionbarsherlock/widget/ActivityChooserView$ActivityChooserViewAdapter;->mMaxActivityCount:I

    .line 771
    .local v5, "oldMaxActivityCount":I
    const v7, 0x7fffffff

    iput v7, p0, Lcom/actionbarsherlock/widget/ActivityChooserView$ActivityChooserViewAdapter;->mMaxActivityCount:I

    .line 773
    const/4 v0, 0x0

    .line 774
    .local v0, "contentWidth":I
    const/4 v4, 0x0

    .line 776
    .local v4, "itemView":Landroid/view/View;
    invoke-static {v8, v8}, Landroid/view/View$MeasureSpec;->makeMeasureSpec(II)I

    move-result v6

    .line 777
    .local v6, "widthMeasureSpec":I
    invoke-static {v8, v8}, Landroid/view/View$MeasureSpec;->makeMeasureSpec(II)I

    move-result v2

    .line 778
    .local v2, "heightMeasureSpec":I
    invoke-virtual {p0}, Lcom/actionbarsherlock/widget/ActivityChooserView$ActivityChooserViewAdapter;->getCount()I

    move-result v1

    .line 780
    .local v1, "count":I
    const/4 v3, 0x0

    .local v3, "i":I
    :goto_0
    if-ge v3, v1, :cond_0

    .line 781
    const/4 v7, 0x0

    invoke-virtual {p0, v3, v4, v7}, Lcom/actionbarsherlock/widget/ActivityChooserView$ActivityChooserViewAdapter;->getView(ILandroid/view/View;Landroid/view/ViewGroup;)Landroid/view/View;

    move-result-object v4

    .line 782
    invoke-virtual {v4, v6, v2}, Landroid/view/View;->measure(II)V

    .line 783
    invoke-virtual {v4}, Landroid/view/View;->getMeasuredWidth()I

    move-result v7

    invoke-static {v0, v7}, Ljava/lang/Math;->max(II)I

    move-result v0

    .line 780
    add-int/lit8 v3, v3, 0x1

    goto :goto_0

    .line 786
    :cond_0
    iput v5, p0, Lcom/actionbarsherlock/widget/ActivityChooserView$ActivityChooserViewAdapter;->mMaxActivityCount:I

    .line 788
    return v0
.end method

.method public setDataModel(Lcom/actionbarsherlock/widget/ActivityChooserModel;)V
    .locals 2
    .param p1, "dataModel"    # Lcom/actionbarsherlock/widget/ActivityChooserModel;

    .prologue
    .line 662
    iget-object v1, p0, Lcom/actionbarsherlock/widget/ActivityChooserView$ActivityChooserViewAdapter;->this$0:Lcom/actionbarsherlock/widget/ActivityChooserView;

    # getter for: Lcom/actionbarsherlock/widget/ActivityChooserView;->mAdapter:Lcom/actionbarsherlock/widget/ActivityChooserView$ActivityChooserViewAdapter;
    invoke-static {v1}, Lcom/actionbarsherlock/widget/ActivityChooserView;->access$000(Lcom/actionbarsherlock/widget/ActivityChooserView;)Lcom/actionbarsherlock/widget/ActivityChooserView$ActivityChooserViewAdapter;

    move-result-object v1

    invoke-virtual {v1}, Lcom/actionbarsherlock/widget/ActivityChooserView$ActivityChooserViewAdapter;->getDataModel()Lcom/actionbarsherlock/widget/ActivityChooserModel;

    move-result-object v0

    .line 663
    .local v0, "oldDataModel":Lcom/actionbarsherlock/widget/ActivityChooserModel;
    if-eqz v0, :cond_0

    iget-object v1, p0, Lcom/actionbarsherlock/widget/ActivityChooserView$ActivityChooserViewAdapter;->this$0:Lcom/actionbarsherlock/widget/ActivityChooserView;

    invoke-virtual {v1}, Lcom/actionbarsherlock/widget/ActivityChooserView;->isShown()Z

    move-result v1

    if-eqz v1, :cond_0

    .line 665
    :try_start_0
    iget-object v1, p0, Lcom/actionbarsherlock/widget/ActivityChooserView$ActivityChooserViewAdapter;->this$0:Lcom/actionbarsherlock/widget/ActivityChooserView;

    # getter for: Lcom/actionbarsherlock/widget/ActivityChooserView;->mModelDataSetOberver:Landroid/database/DataSetObserver;
    invoke-static {v1}, Lcom/actionbarsherlock/widget/ActivityChooserView;->access$1200(Lcom/actionbarsherlock/widget/ActivityChooserView;)Landroid/database/DataSetObserver;

    move-result-object v1

    invoke-virtual {v0, v1}, Lcom/actionbarsherlock/widget/ActivityChooserModel;->unregisterObserver(Ljava/lang/Object;)V
    :try_end_0
    .catch Ljava/lang/IllegalStateException; {:try_start_0 .. :try_end_0} :catch_1

    .line 670
    :cond_0
    :goto_0
    iput-object p1, p0, Lcom/actionbarsherlock/widget/ActivityChooserView$ActivityChooserViewAdapter;->mDataModel:Lcom/actionbarsherlock/widget/ActivityChooserModel;

    .line 671
    if-eqz p1, :cond_1

    iget-object v1, p0, Lcom/actionbarsherlock/widget/ActivityChooserView$ActivityChooserViewAdapter;->this$0:Lcom/actionbarsherlock/widget/ActivityChooserView;

    invoke-virtual {v1}, Lcom/actionbarsherlock/widget/ActivityChooserView;->isShown()Z

    move-result v1

    if-eqz v1, :cond_1

    .line 673
    :try_start_1
    iget-object v1, p0, Lcom/actionbarsherlock/widget/ActivityChooserView$ActivityChooserViewAdapter;->this$0:Lcom/actionbarsherlock/widget/ActivityChooserView;

    # getter for: Lcom/actionbarsherlock/widget/ActivityChooserView;->mModelDataSetOberver:Landroid/database/DataSetObserver;
    invoke-static {v1}, Lcom/actionbarsherlock/widget/ActivityChooserView;->access$1200(Lcom/actionbarsherlock/widget/ActivityChooserView;)Landroid/database/DataSetObserver;

    move-result-object v1

    invoke-virtual {p1, v1}, Lcom/actionbarsherlock/widget/ActivityChooserModel;->registerObserver(Ljava/lang/Object;)V
    :try_end_1
    .catch Ljava/lang/IllegalStateException; {:try_start_1 .. :try_end_1} :catch_0

    .line 678
    :cond_1
    :goto_1
    invoke-virtual {p0}, Lcom/actionbarsherlock/widget/ActivityChooserView$ActivityChooserViewAdapter;->notifyDataSetChanged()V

    .line 679
    return-void

    .line 674
    :catch_0
    move-exception v1

    goto :goto_1

    .line 666
    :catch_1
    move-exception v1

    goto :goto_0
.end method

.method public setMaxActivityCount(I)V
    .locals 1
    .param p1, "maxActivityCount"    # I

    .prologue
    .line 792
    iget v0, p0, Lcom/actionbarsherlock/widget/ActivityChooserView$ActivityChooserViewAdapter;->mMaxActivityCount:I

    if-eq v0, p1, :cond_0

    .line 793
    iput p1, p0, Lcom/actionbarsherlock/widget/ActivityChooserView$ActivityChooserViewAdapter;->mMaxActivityCount:I

    .line 794
    invoke-virtual {p0}, Lcom/actionbarsherlock/widget/ActivityChooserView$ActivityChooserViewAdapter;->notifyDataSetChanged()V

    .line 796
    :cond_0
    return-void
.end method

.method public setShowDefaultActivity(ZZ)V
    .locals 1
    .param p1, "showDefaultActivity"    # Z
    .param p2, "highlightDefaultActivity"    # Z

    .prologue
    .line 827
    iget-boolean v0, p0, Lcom/actionbarsherlock/widget/ActivityChooserView$ActivityChooserViewAdapter;->mShowDefaultActivity:Z

    if-ne v0, p1, :cond_0

    iget-boolean v0, p0, Lcom/actionbarsherlock/widget/ActivityChooserView$ActivityChooserViewAdapter;->mHighlightDefaultActivity:Z

    if-eq v0, p2, :cond_1

    .line 829
    :cond_0
    iput-boolean p1, p0, Lcom/actionbarsherlock/widget/ActivityChooserView$ActivityChooserViewAdapter;->mShowDefaultActivity:Z

    .line 830
    iput-boolean p2, p0, Lcom/actionbarsherlock/widget/ActivityChooserView$ActivityChooserViewAdapter;->mHighlightDefaultActivity:Z

    .line 831
    invoke-virtual {p0}, Lcom/actionbarsherlock/widget/ActivityChooserView$ActivityChooserViewAdapter;->notifyDataSetChanged()V

    .line 833
    :cond_1
    return-void
.end method

.method public setShowFooterView(Z)V
    .locals 1
    .param p1, "showFooterView"    # Z

    .prologue
    .line 803
    iget-boolean v0, p0, Lcom/actionbarsherlock/widget/ActivityChooserView$ActivityChooserViewAdapter;->mShowFooterView:Z

    if-eq v0, p1, :cond_0

    .line 804
    iput-boolean p1, p0, Lcom/actionbarsherlock/widget/ActivityChooserView$ActivityChooserViewAdapter;->mShowFooterView:Z

    .line 805
    invoke-virtual {p0}, Lcom/actionbarsherlock/widget/ActivityChooserView$ActivityChooserViewAdapter;->notifyDataSetChanged()V

    .line 807
    :cond_0
    return-void
.end method


text:
'''
Given a string s and a dictionary of words dict, determine if s can be segmented into a space-separated sequence of one or more dictionary words.

For example, given
s = "leetcode",
dict = ["leet", "code"].

Return true because "leetcode" can be segmented as "leet code".
'''

class Solution(object):
    def wordBreak(self, s, wordDict):
        """
        :type s: str
        :type wordDict: Set[str]
        :rtype: bool
        """
        n = len(s)
        dp = [False] * (n + 1)
        dp[0] = True
        for i in range(n):
            for j in range(i, -1, -1):
                if dp[j] and s[j:i + 1] in wordDict:
                    dp[i + 1] = True
                    break
        return dp[n]

if __name__ == "__main__":
    assert Solution().wordBreak("leetcode", {"leet", "code"}) == True


text:
package org.zaproxy.zap.extension.sse.ui.httppanel.views.large;

import org.zaproxy.zap.extension.httppanel.Message;
import org.zaproxy.zap.extension.httppanel.view.largeresponse.LargeResponseUtil;
import org.zaproxy.zap.extension.sse.ServerSentEvent;

public class EventStreamLargeEventUtil extends LargeResponseUtil {

    public static boolean isLargeEvent(Message aMessage) {
        if (aMessage instanceof ServerSentEvent) {
            ServerSentEvent message = (ServerSentEvent) aMessage;
            Long length = message.getRawEventLength();
            if (length == null) {
                return false;
            }
            return length > minContentLength;
        }

        return false;
    }
}


text:
<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="40dp"
    android:height="40dp"
    android:viewportWidth="40"
    android:viewportHeight="40"
    android:tint="?attr/colorControlNormal">
  <path
      android:fillColor="@android:color/white"
      android:pathData="M5.25,29.75V10.25H34.75V29.75Z"/>
</vector>


text:
<?php

namespace lukisongroup\purchasing\models\data_term;

use Yii;
use yii\base\Model;
use yii\data\ActiveDataProvider;
use lukisongroup\purchasing\models\data_term\Termheader;
use lukisongroup\purchasing\models\data_term\Requesttermheader;

/**
 * TermheaderSearch represents the model behind the search form about `lukisongroup\master\models\Termheader`.
 */
class TermheaderSearch extends Termheader
{
    /**
     * @inheritdoc
     */

	/* public function attributes()
	{
		//Author -ptr.nov- add related fields to searchable attributes
		return array_merge(parent::attributes(), ['cus.CUST_NM','dis.NM_DISTRIBUTOR','corp.CORP_NM']);
	} */

    public $NmCustomer;
    public $Nmprincipel;
    public $NmDis;

    public function rules()
    {
        return [
            [[ 'STATUS'], 'integer'],
            [['GENERAL_TERM','CUST_KD_PARENT','PRINCIPAL_KD','DIST_KD','PERIOD_START', 'PERIOD_END', 'TARGET_TEXT', 'RABATE_CNDT', 'TOP', 'CREATED_BY', 'CREATED_AT', 'UPDATE_BY', 'UPDATE_AT','NmCustomer','Nmprincipel','NmDis'], 'safe'],
            [['TARGET_VALUE', 'GROWTH'], 'number'],
        ];
    }

    /**
     * @inheritdoc
     */
    public function scenarios()
    {
        // bypass scenarios() implementation in the parent class
        return Model::scenarios();
    }

    /**
     * Creates data provider instance with search query applied
     *
     * @param array $params
     *
     * @return ActiveDataProvider
     */
     public function searchcusbyid($params,$id)
     {

         $query = Termheader::find();
        //  ->andwhere(['like','KD_RIB','RI'])->andwhere(['like','KD_RIB','RID']);

         $dataProvider = new ActiveDataProvider([
             'query' => $query,
         ]);

         $this->load($params);

         if (!$this->validate()) {
             // uncomment the following line if you do not want to return any records when validation fails
             // $query->where('0=1');
             return $dataProvider;
         }

         $query->andFilterWhere([
			 'CUST_KD_PARENT' => $this->CUST_KD_PARENT,
             'PERIOD_START' => $this->PERIOD_START,
             'PERIOD_END' => $this->PERIOD_END,
             'TARGET_VALUE' => $this->TARGET_VALUE,
             'GROWTH' => $this->GROWTH,
             'STATUS' => $this->STATUS,
             'CREATED_AT' => $this->CREATED_AT,
             'UPDATE_AT' => $this->UPDATE_AT,
         ]);

         $query->andFilterWhere(['like', 'CUST_KD_PARENT', $this->CUST_KD_PARENT])
			 ->andFilterWhere(['like', 'CUST_KD_PARENT', $this->CUST_KD_PARENT])
             ->andFilterWhere(['like', 'PRINCIPAL_KD', $this->PRINCIPAL_KD])
             ->andFilterWhere(['like', 'DIST_KD', $this->DIST_KD])
             ->andFilterWhere(['like', 'TARGET_TEXT', $this->TARGET_TEXT])
             ->andFilterWhere(['like', 'RABATE_CNDT', $this->RABATE_CNDT])
             ->andFilterWhere(['like', 'TOP', $this->TOP])
             ->andFilterWhere(['like', 'CREATED_BY', $this->CREATED_BY])
             ->andFilterWhere(['like', 'UPDATE_BY', $this->UPDATE_BY]);

             $query->orderby(['CREATED_AT'=>SORT_DESC]); //SORT PENTING UNTUK RECURSIVE BIAR TREE BISA URUTAN, save => (IF (PATENT =0) {SORT=ID}, ELSE {

         return $dataProvider;
     }

    public function search($params)
    {
      	$profile=Yii::$app->getUserOpt->Profile_user();

        // if($profile->emp->DEP_ID == 'GM'|| $profile->emp->DEP_ID == 'DRC')
        //   {
        //     $query = Termheader::find();
        //   }
        // elseif($profile->emp->DEP_ID == 'ACT')
        // {
        //     $query = Termheader::find();
        // }else{
        //       // $query = Termheader::find()->where(['CREATED_BY'=>$profile->username]);
        //       $query = Termheader::find();
        //   }

        $query = Termheader::find();

        $dataProvider = new ActiveDataProvider([
            'query' => $query,
        ]);

        $this->load($params);

        if (!$this->validate()) {
            // uncomment the following line if you do not want to return any records when validation fails
            // $query->where('0=1');
            return $dataProvider;
        }

        $query->andFilterWhere([
            'PERIOD_START' => $this->PERIOD_START,
            'PERIOD_END' => $this->PERIOD_END,
            'TARGET_VALUE' => $this->TARGET_VALUE,
            'GROWTH' => $this->GROWTH,
            'STATUS' => $this->STATUS,
            'CREATED_AT' => $this->CREATED_AT,
            'UPDATE_AT' => $this->UPDATE_AT,
        ]);

        $query->andFilterWhere(['like', 'CUST_KD_PARENT', $this->NmCustomer])
            ->andFilterWhere(['like', 'PRINCIPAL_KD', $this->Nmprincipel])
            ->andFilterWhere(['like', 'DIST_KD', $this->NmDis])
            ->andFilterWhere(['like', 'TARGET_TEXT', $this->TARGET_TEXT])
            ->andFilterWhere(['like', 'RABATE_CNDT', $this->RABATE_CNDT])
            ->andFilterWhere(['like', 'TOP', $this->TOP])
            ->andFilterWhere(['like', 'CREATED_BY', $this->CREATED_BY])
            ->andFilterWhere(['like', 'UPDATE_BY', $this->UPDATE_BY]);

            $query->orderby(['CREATED_AT'=>SORT_DESC]); //SORT PENTING UNTUK RECURSIVE BIAR TREE BISA URUTAN, save => (IF (PATENT =0) {SORT=ID}, ELSE {

        return $dataProvider;
    }
}


text:
set :theme, "calagator"

# set :scm, "git"
# set :branch, "master" unless variables[:branch]
# set :repository,  "git://github.com/calagator/calagator.git"
# set :deploy_via, :remote_cache

set :scm, "git"
set :repository,  "."
set :deploy_via, :copy
set :copy_cache, true
set :copy_exclude, ['.git', 'log', 'tmp', '*.sql', '*.diff', 'coverage.info', 'coverage.info', 'coverage', 'public/images/members', 'public/system', 'tags', 'db/remote.sql', 'db/*.sqlite3', '*.swp', '.*.swp']
default_run_options[:pty] = true

set :deploy_to, "/var/www/calagator"
set :host, "calagator.org"
set :user, "calagator"

role :app, host
role :web, host
role :db,  host, :primary => true
default_run_options[:pty] = true


text:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>Filibuster</title> <link rel="stylesheet" href="styles.css">
<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro" rel="stylesheet">

Results for "news_disastertype"

Index

stricken

northern California wracked by earthquake

flooded

flooded

stricken

flooded

flooded

flooded

stricken

San Francisco suffers massive earthquake

the Carribean suffers minor tremors

northern California wracked by earthquake

stricken

flooded

Indonesia wracked by earthquake

the Carribean wracked by minor tremors

Florida savaged by massive earthquake

stricken

flooded

flooded


text:
namespace grok {
namespace libs {

/// ArraySort ::= sorts a JS array, default property of every array
extern std::shared_ptr<grok::obj::Object>
ArraySort(std::shared_ptr<grok::obj::Argument>);

} // libs
} // grok

#endif // array-sort.h


text:
import moment from 'moment'

console.log(moment().format('MMMM Do YYYY, h:mm:ss a'))


text:
import { ImageSource } from './imageSource';
import { Point } from './point';
import { Nullable } from './nullable';

export interface LayerImage {
  topLeft: Point;
  bottomRight: Point;
  imageId?: string;
}

export type LegacyLayerImage = Pick<
  LayerImage,
  Exclude<keyof LayerImage, 'sourceId'>
> & {
  source?: Nullable<ImageSource>;
};


text:
package jsettlers.common.logging;

/**
 * this class implements a simple stop watch.
 *
 * @author Andreas Eberle
 *
 */
public abstract class StopWatch {

	private long start;

	public StopWatch() {
		restart();
	}

	/**
	 * saves the current time.
	 */
	public final void restart() {
		start = now();
	}

	/**
	 * calculates the difference from start to now and prints the result.
	 *
	 * @param leadingText
	 *            text to be pretended to the measured difference
	 */
	public void stop(String leadingText) {
		System.out.println(leadingText + ": " + getDiff() + " " + getUnit());
	}

	protected abstract String getUnit();

	/**
	 *
	 * @return Returns the difference in time from the start (or last restart) to now.
	 */
	public final long getDiff() {
		return now() - start;
	}

	/**
	 *
	 * @return Returns the current time in the unit of this {@link StopWatch}.
	 */
	public abstract long now();
}


text:
.. Licensed to the Apache Software Foundation (ASF) under one
   or more contributor license agreements.  See the NOTICE file
   distributed with this work for additional information
   regarding copyright ownership.  The ASF licenses this file
   to you under the Apache License, Version 2.0 (the
   "License"); you may not use this file except in compliance
   with the License.  You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing,
   software distributed under the License is distributed on an
   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
   KIND, either express or implied.  See the License for the
   specific language governing permissions and limitations
   under the License.

.. include:: ../../common.defs

.. highlight:: cpp
.. default-domain:: cpp

.. _BufferWriter:

BufferWriter
*************

Synopsis
++++++++

.. code-block:: cpp

   #include <ts/BufferWriter.h>

Description
+++++++++++

:class:`BufferWriter` is designed to make writing text to a buffer fast, convenient, and safe. It is
easier and less error-prone than using a combination of :code:`sprintf` and :code:`memcpy` as is
done in many places in the code.. A :class:`BufferWriter` can have a size and will prevent writing
past the end, while tracking the theoretical output to enable buffer resizing after the fact. This
also lets a :class:`BufferWriter` instance write into the middle of a larger buffer, making nested
output logic easy to build.

The header files are divided in to two variants. ``BufferWriter.h`` provides the basic capabilities
of buffer output control. ``BufferWriterFormat.h`` provides formatted output mechanisms, primarily
the implementation and ancillary classes for :func:`BufferWriter::print`.

:class:`BufferWriter` is an abstract base class, in the style of :code:`std::ostream`. There are
several subclasses for various use cases. When passing around this is the common type.

:class:`FixedBufferWriter` writes to an externally provided buffer of a fixed length. The buffer must
be provided to the constructor. This will generally be used in a function where the target buffer is
external to the function or already exists.

:class:`LocalBufferWriter` is a templated class whose template argument is the size of an internal
buffer. This is useful when the buffer is local to a function and the results will be transferred
from the buffer to other storage after the output is assembled. Rather than having code like

.. code-block:: cpp

   char buff[1024];
   ts::FixedBufferWriter w(buff, sizeof(buff));

can be more compactly and robustly done as:

.. code-block:: cpp

   ts::LocalBufferWriter<1024> w;

In many cases using :class:`LocalBufferWriter` this is the only place the size of the buffer needs
to be specified, and therefore can simply be a constant without the overhead of defining a size to
maintain consistency.

Writing
-------

The basic mechanism for writing to a :class:`BufferWriter` is :func:`BufferWriter::write`.
This is an overloaded method for a character (:code:`char`), a buffer (:code:`void *, size_t`)
and a string view (:class:`string_view`). Because there is a constructor for :class:`string_view`
that takes a :code:`const char*` as a C string, passing a literal string works as expected.

There are also stream operators in the style of C++ stream I/O. The basic template is

.. code-block:: cpp

   template < typename T > ts::BufferWriter& operator << (ts::BufferWriter& w, T const& t);

Several basic types are overloaded and it is easy to extend to additional types. For instance, to make :code:`ts::TextView` work with :class:`BufferWriter`, the code would be

.. code-block:: cpp

   ts::BufferWriter & operator << (ts::BufferWriter & w, TextView const & sv) {
      w.write(sv.data(), sv.size());
      return w;
   }

Reading
-------

The data in the buffer can be extracted using :func:`BufferWriter::data`. This and
:func:`BufferWriter::size` return a pointer to the start of the buffer and the amount of data
written to the buffer. This is very similar to :func:`BufferWriter::view` which returns a
:class:`string_view` which covers the output data. Calling :func:`BufferWriter::error` will indicate
if more data than space available was written. :func:`BufferWriter::extent` returns the amount of
data written to the :class:`BufferWriter`. This can be used in a two pass style with a null / size 0
buffer to determine the buffer size required for the full output.

Advanced
--------

The :func:`BufferWriter::clip` and :func:`BufferWriter::extend` methods can be used to reserve space
in the buffer. A common use case for this is to guarantee matching delimiters in output if buffer
space is exhausted. :func:`BufferWriter::clip` can be used to temporarily reduce the buffer size by
an amount large enough to hold the terminal delimiter. After writing the contained output,
:func:`BufferWriter::extend` can be used to restore the capacity and then output the terminal
delimiter.

.. warning:: **Never** call :func:`BufferWriter::extend` without previously calling :func:`BufferWriter::clip` and always pass the same argument value.

:func:`BufferWriter::remaining` returns the amount of buffer space not yet consumed.

:func:`BufferWriter::auxBuffer` returns a pointer to the first byte of the buffer not yet used. This
is useful to do speculative output, or do bounded output in a manner similar to use
:func:`BufferWriter::clip` and :func:`BufferWriter::extend`. A new :class:`BufferWriter` instance
can be constructed with

.. code-block:: cpp

   ts::FixedBufferWriter subw(w.auxBuffer(), w.remaining());

Output can be written to :arg:`subw`. If successful, then :code:`w.fill(subw.size())` will add that
output to the main buffer. Depending on the purpose, :code:`w.fill(subw.extent())` can be used -
this will track the attempted output if sizing is important. Note that space for any terminal
markers can be reserved by bumping down the size from :func:`BufferWriter::remaining`. Be careful of
underrun as the argument is an unsigned type.

If there is an error then :arg:`subw` can be ignored and some suitable error output written to
:arg:`w` instead. A common use case is to verify there is sufficient space in the buffer and create
a "not enough space" message if not. E.g.

.. code-block:: cpp

   ts::FixedBufferWriter subw(w.auxBuffer(), w.remaining());
   this->write_some_output(subw);
   if (!subw.error()) w.fill(subw.size());
   else w << "Insufficient space"_sv;

Examples
++++++++

For example, error prone code that looks like

.. code-block:: cpp

   char new_via_string[1024]; // 512-bytes for hostname+via string, 512-bytes for the debug info
   char * via_string = new_via_string;
   char * via_limit  = via_string + sizeof(new_via_string);

   // ...

   * via_string++ = ' ';
   * via_string++ = '[';

   // incoming_via can be max MAX_VIA_INDICES+1 long (i.e. around 25 or so)
   if (s->txn_conf->insert_request_via_string > 2) { // Highest verbosity
      via_string += nstrcpy(via_string, incoming_via);
   } else {
      memcpy(via_string, incoming_via + VIA_CLIENT, VIA_SERVER - VIA_CLIENT);
      via_string += VIA_SERVER - VIA_CLIENT;
   }
   *via_string++ = ']';

becomes

.. code-block:: cpp

   ts::LocalBufferWriter<1024> w; // 1K internal buffer.

   // ...

   w << " [";
   if (s->txn_conf->insert_request_via_string > 2) { // Highest verbosity
      w << incoming_via;
   } else {
      w << ts::string_view{incoming_via + VIA_CLIENT, VIA_SERVER - VIA_CLIENT};
   }
   w << ']';

Note that in addition there will be no overrun on the memory buffer in :arg:`w`, in strong contrast
to the original code.

Reference
+++++++++

.. class:: BufferWriter

   :class:`BufferWriter` is the abstract base class which defines the basic client interface. This
   is intended to be the reference type used when passing concrete instances rather than having to
   support the distinct types.

   .. function:: BufferWriter & write(void * data, size_t length)

      Write to the buffer starting at :arg:`data` for at most :arg:`length` bytes. If there is not
      enough room to fit all the data, none is written.

   .. function:: BufferWriter & write(string_view str)

      Write the string :arg:`str` to the buffer. If there is not enough room to write the string no
      data is written.

   .. function:: BufferWriter & write(char c)

      Write the character :arg:`c` to the buffer. If there is no space in the buffer the character
      is not written.

   .. function:: fill(size_t n)

      Increase the output size by :arg:`n` without changing the buffer contents. This is used in
      conjuction with :func:`BufferWriter::auxBuffer` after writing output to the buffer returned by
      that method. If this method is not called then such output will not be counted by
      :func:`BufferWriter::size` and will be overwritten by subsequent output.

   .. function:: char * data() const

      Return a pointer to start of the buffer.

   .. function:: size_t size() const

      Return the number of valid (written) bytes in the buffer.

   .. function:: string_view view() const

      Return a :class:`string_view` that covers the valid data in the buffer.

   .. function:: size_t remaining() const

      Return the number of available remaining bytes that could be written to the buffer.

   .. function:: size_t capacity() const

      Return the number of bytes in the buffer.

   .. function:: char * auxBuffer() const

      Return a pointer to the first byte in the buffer not yet consumed.

   .. function:: BufferWriter & clip(size_t n)

      Reduce the available space by :arg:`n` bytes.

   .. function:: BufferWriter & extend(size_t n)

      Increase the available space by :arg:`n` bytes. Extreme care must be used with this method as
      :class:`BufferWriter` will trust the argument, having no way to verify it. In general this
      should only be used after calling :func:`BufferWriter::clip` and passing the same value.
      Together these allow the buffer to be temporarily reduced to reserve space for the trailing
      element of a required pair of output strings, e.g. making sure a closing quote can be written
      even if part of the string is not.

   .. function:: bool error() const

      Return :code:`true` if the buffer has overflowed from writing, :code:`false` if not.

   .. function:: size_t extent() const

      Return the total number of bytes in all attempted writes to this buffer. This value allows a
      successful retry in case of overflow, presuming the output data doesn't change. This works
      well with the standard "try before you buy" approach of attempting to write output, counting
      the characters needed, then allocating a sufficiently sized buffer and actually writing.

   .. function:: BufferWriter & print(TextView fmt, ...)

      Print the arguments according to the format. See `bw-formatting`_.

.. class:: FixedBufferWriter : public BufferWriter

   This is a class that implements :class:`BufferWriter` on a fixed buffer, passed in to the constructor.

   .. function:: FixedBufferWriter(void * buffer, size_t length)

      Construct an instance that will write to :arg:`buffer` at most :arg:`length` bytes. If more
      data is written, all data past the maximum size is discarded.

   .. function:: reduce(size_t n)

      Roll back the output to :arg:`n` bytes. This is useful primarily for clearing the buffer by
      calling :code:`reduce(0)`.

   .. function:: FixedBufferWriter auxWriter(size_t reserve = 0)

      Create a new instance of :class:`FixedBufferWriter` for the remaining output buffer. If
      :arg:`reserve` is non-zero then if possible the capacity of the returned instance is reduced
      by :arg:`reserve` bytes, in effect reserving that amount of space at the end. Note the space will
      not be reserved if :arg:`reserve` is larger than the remaining output space.

.. class:: template < size_t N > LocalBufferWriter : public BufferWriter

   This is a convenience class which is a subclass of :class:`FixedBufferWriter`. It which creates a
   buffer as a member rather than having an external buffer that is passed to the instance. The
   buffer is :arg:`N` bytes long.

   .. function:: LocalBufferWriter::LocalBufferWriter()

      Construct an instance with a capacity of :arg:`N`.

.. _bw-formatting:

Formatted Output
++++++++++++++++

:class:`BufferWriter` supports formatting output in a style similar to Python formatting via
:func:`BufferWriter::print`. This takes a format string which then controls the use of subsquent
arguments in generating out in the buffer. The basic format is divided in to three parts, separated by colons.

.. productionList:: BufferWriterFormat
   Format: "{" [name] [":" [specifier] [":" extension]] "}"
   name: index | name
   extension: <printable character except "{}">*

:arg:`name`
   The name of the argument to use. This can be a number in which case it is the zero based index of the argument to the method call. E.g. ``{0}`` means the first argument and ``{2}`` is the third argument after the format.

      ``bw.print("{0} {1}", 'a', 'b')`` => ``a b``

      ``bw.print("{1} {0}", 'a', 'b')`` => ``b a``

   The name can be omitted in which case it is treated as an index in parallel to the position in
   the format string. Only the position in the format string matters, not what names those other
   format elements may have used.

      ``bw.print("{0} {2} {}", 'a', 'b', 'c')`` => ``a c c``

      ``bw.print("{0} {2} {2}", 'a', 'b', 'c')`` => ``a c c``

   Note that an argument can be printed more than once if the name is used more than once.

      ``bw.print("{0} {} {0}", 'a', 'b')`` => ``a b a``

      ``bw.print("{0} {1} {0}", 'a', 'b')`` => ``a b a``

   Alphanumeric names refer to values in a global table. These will be described in more detail someday.

:arg:`specifier`
   Basic formatting control.

   .. productionList:: specifier
      specifier: [[fill]align][sign]["#"]["0"][[min][.precision][,max][type]]
      fill: <printable character except "{}%:"> | URI-char
      URI-char: "%" hex-digit hex-digit
      align: "<" | ">" | "=" | "^"
      sign: "+" | "-" | " "
      min: integer
      precision: integer
      max: integer
      type: "x" | "o" | "b"

   The output is placed in a field that is at least :token:`min` wide and no more than :token:`max` wide. If
   the output is less than :token:`min` then

      *  The :token:`fill` character is used for the extra space required. This can be an explicit
         character or a URI encoded one (to allow otherwise reserved characters).
      *  The output is shifted according to the :token:`align`.

         <
            Align to the left, fill to the right.

         >
            Align to the right, fill to the left.

         ^
            Align in the middle, fill to left and right.

         =
            Numerically align, putting the fill between the output and the sign character.

   The output is clipped by :token:`max` width characters or the end of the buffer. :token:`precision` is used by
   floating point values to specify the number of places of precision. The precense of the ``#`` character is used for
   integer values and causes a radix indicator to be used (one of ``0xb``, ``0``, ``0x``).

   :token:`type` is used to indicate type specific formatting. For integers it indicates the output
   radix. If ``#`` is present the radix is prefix is generated with case matching that of the type
   (e.g. type ``x`` causes ``0x`` and type ``X`` causes ``0X``).

      = ===============
      b binary
      o octal
      x hexadecimal
      = ===============

:arg:`extension`
   Text (excluding braces) that is passed to the formatting function. This can be used to provide
   extensions for specific argument types (e.g., IP addresses). The base logic ignores it but passes
   it on to the formatting function for the corresponding argument type which can then behave
   different based on the extension.

User Defined Formatting
+++++++++++++++++++++++

When an value needs to be formatted an overloaded function for type :code:`V` is called.

.. code-block:: cpp

   BufferWriter& ts::bwformat(BufferWriter& w, BWFSpec const& spec, V const& v)

This can (and should be) overloaded for user defined types. This makes it easier and cheaper to
build one overload on another by tweaking the :arg:`spec` as it passed through. The calling
framework will handle basic alignment, the overload does not need to unless the alignment
requirements are more detailed (e.g. integer alignment operations).

The output stream operator :code:`operator<<` is defined to call this function with a default
constructed :code:`BWFSpec` instance.

Futures
+++++++

A planned future extension is a variant of :class:`BufferWriter` that operates on a
:code:`MIOBuffer`. This would be very useful in many places that work with :code:`MIOBuffer`
instances, most specifically in the body factory logic.


text:
export interface MakerDebConfigOptions {
  /**
   * Name of the package (e.g. atom), used in the Package field of the control
   * specification.
   *
   * Package names [...] must consist only of lower case letters (a-z), digits
   * (0-9), plus (+) and minus (-) signs, and periods (.). They must be at
   * least two characters long and must start with an alphanumeric character.
   */
  name?: string;
  /**
   * Name of the application (e.g. Atom), used in the Name field of the desktop specification.
   */
  productName?: string;
  /**
   * Generic name of the application (e.g. Text Editor), used in the GenericName field of the
   * desktop specification.
   */
  genericName?: string;
  /**
   * Short description of the application, used in the Description field of the control
   * specification.
   */
  description?: string;
  /**
   * Long description of the application, used in the Description field of the control
   * specification.
   */
  productDescription?: string;
  /**
   * Version number of the package, used in the Version field of the control specification.
   */
  version?: string;
  /**
   * Revision number of the package, used in the Version field of the control specification.
   */
  revision?: string;
  /**
   * Application area into which the package has been classified.
   *
   * Possible sections.  Generated on https://packages.debian.org/unstable/ with:
   *
   * ```javascript
   * $$('#content dt a').map(n => {
   *   const ss = n.href.split('/');
   *   return `'${ss[ss.length - 2]}'`;
   * }).sort().join(' | ')
   * ```
   */
  section?:
    | 'admin'
    | 'cli-mono'
    | 'comm'
    | 'database'
    | 'debian-installer'
    | 'debug'
    | 'devel'
    | 'doc'
    | 'editors'
    | 'education'
    | 'electronics'
    | 'embedded'
    | 'fonts'
    | 'games'
    | 'gnome'
    | 'gnu-r'
    | 'gnustep'
    | 'graphics'
    | 'hamradio'
    | 'haskell'
    | 'httpd'
    | 'interpreters'
    | 'introspection'
    | 'java'
    | 'javascript'
    | 'kde'
    | 'kernel'
    | 'libdevel'
    | 'libs'
    | 'lisp'
    | 'localization'
    | 'mail'
    | 'math'
    | 'metapackages'
    | 'misc'
    | 'net'
    | 'news'
    | 'ocaml'
    | 'oldlibs'
    | 'otherosfs'
    | 'perl'
    | 'php'
    | 'python'
    | 'ruby'
    | 'rust'
    | 'science'
    | 'shells'
    | 'sound'
    | 'tasks'
    | 'tex'
    | 'text'
    | 'utils'
    | 'vcs'
    | 'video'
    | 'virtual'
    | 'web'
    | 'x11'
    | 'xfce'
    | 'zope';
  /**
   * How important is it to have the package installed.
   *
   * You can read more: https://www.debian.org/doc/debian-policy/#priorities
   */
  priority?: 'required' | 'important' | 'standard' | 'optional';
  /**
   * Estimate of the total amount of disk space required to install the named package,
   * used in the Installed-Size field of the control specification.
   */
  size?: number;
  /**
   * Relationships to other packages, used in the Depends field of the control specification.
   */
  depends?: string[];
  /**
   * Relationships to other packages, used in the Recommends field of the control specification.
   */
  recommends?: string[];
  /**
   * Relationships to other packages, used in the Suggests field of the control specification.
   */
  suggests?: string[];
  /**
   * Relationships to other packages, used in the Enhances field of the control specification.
   */
  enhances?: string[];
  /**
   * Relationships to other packages, used in the Pre-Depends field of the control specification.
   */
  preDepends?: string[];
  /**
   * Maintainer of the package, used in the Maintainer field of the control specification.
   */
  maintainer?: string;
  /**
   * URL of the homepage for the package, used in the Homepage field of the control specification.
   */
  homepage?: string;
  /**
   * Relative path to the executable that will act as binary for the application, used in the Exec
   * field of the desktop specification.
   *
   * Defaults to options.name
   */
  bin?: string;
  /**
   * Path to a single image that will act as icon for the application:
   */
  icon?: string;
  /**
   * Categories in which the application should be shown in a menu, used in the Categories field
   * of the desktop specification.
   *
   * Generated on https://specifications.freedesktop.org/menu-spec/latest/apa.html with:
   *
   * `(${$$('.informaltable tr td:first-child').map(td => `'$\{td.innerText\}'`).join(' | ')})[]`
   */
  categories?: (
    | 'AudioVideo'
    | 'Audio'
    | 'Video'
    | 'Development'
    | 'Education'
    | 'Game'
    | 'Graphics'
    | 'Network'
    | 'Office'
    | 'Science'
    | 'Settings'
    | 'System'
    | 'Utility'
  )[];
  /**
   * MIME types the application is able to open, used in the MimeType field of the desktop
   * specification.
   */
  mimeType?: string[];
  /**
   * You can use these to quieten lintian.
   */
  lintianOverrides?: string[];
  /**
   * Path to package maintainer scripts with their corresponding name, used in the installation
   * procedure.
   *
   * Read More:
   * https://www.debian.org/doc/debian-policy/#package-maintainer-scripts-and-installation-procedure
   */
  scripts?: {
    preinst?: string;
    postinst?: string;
    prerm?: string;
    postrm?: string;
  };
  /**
   * The absolute path to a custom template for the generated FreeDesktop.org desktop entry file.
   */
  desktopTemplate?: string;
}

export interface MakerDebConfig {
  options?: MakerDebConfigOptions;
}


text:
package com.blogspot.toomuchcoding.book.chapter9.exception;

public class CustomException extends RuntimeException {

}


text:
layout: page
title: Vang Ice Llc. Party
date: 2016-05-24
author: Gregory Gardner
tags: weekly links, java
status: published
summary: Etiam ultricies nunc sed hendrerit pharetra.
banner: images/banner/wedding.jpg
booking:
  startDate: 02/22/2017
  endDate: 02/26/2017
  ctyhocn: SLCWJHX
  groupCode: VILP
published: true
---
Integer sit amet scelerisque turpis, eu condimentum diam. Etiam libero justo, fermentum in ipsum quis, eleifend malesuada felis. Duis dignissim semper ligula, sed vestibulum dui vehicula nec. Suspendisse a ante euismod, dignissim ipsum non, porttitor diam. Praesent blandit nulla vitae elit commodo, nec tincidunt sem suscipit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Integer et ex ut eros rhoncus viverra. Vivamus pulvinar ornare massa, vel ultricies enim volutpat non.
Duis iaculis ex quis enim suscipit, non semper metus iaculis. Donec accumsan est semper nunc mattis vulputate. Nam bibendum rhoncus eros, eu condimentum tortor mattis eu. Sed aliquet mi justo. Vestibulum elementum porttitor dignissim. Duis varius nec mauris non mollis. Aliquam erat volutpat. Mauris et venenatis neque.

1 Aenean laoreet mauris sed justo vulputate, eu tincidunt tellus tristique
1 Donec consectetur erat blandit ultrices dapibus
1 Fusce a ante pulvinar mi tincidunt blandit.

Morbi aliquam mauris id tellus aliquet, eu tempor massa facilisis. Fusce lacinia quam id enim malesuada, in hendrerit libero tristique. Nullam elit tortor, hendrerit ac eleifend in, fringilla quis risus. In et tortor rhoncus, posuere nunc vitae, tempus sapien. Aenean vel ante nulla. Aliquam et tempor felis, a accumsan urna. Maecenas in enim justo. Suspendisse lectus metus, sagittis a arcu quis, ullamcorper placerat lacus. Nullam molestie tellus leo, at blandit justo bibendum id. Pellentesque blandit purus eget sagittis eleifend. Donec eu sollicitudin urna, ac auctor magna. Nunc vestibulum turpis mi, sit amet pulvinar mi maximus in. Praesent eu malesuada nulla, ut malesuada lorem. Sed ullamcorper nunc et ante viverra vehicula. Maecenas molestie erat a dolor lobortis, non tempus metus pulvinar. Sed in dui sit amet eros ornare lobortis.


text:
angular.module('seoApp').factory('PropertyService', [function() {
  var service = {},
    properties = require('properties'),
    fns = properties.getProperties(),
    slug = require('urlUtils').slug,
    titles = [];

  for (var i in fns) {
    titles.push(fns[i].title);
  }

  service.getPropertyNames = function() {
    return titles;
  }

  service.isPropertyFunction = function(name) {
    return titles.indexOf(name) >= 0;
  };

  service.getPropertyBySlug = function(text) {
    for (var i in fns) {
      if (slug(fns[i].title) === text) {
        return fns[i];
      }
    }
    return null;
  };

  service.getAllPageProperties = function(site, pages) {
    var result = [];
    for (var i in fns) {
      var tmp = {title: fns[i].title, description: fns[i].description};
        result.push(tmp);
      };
    return result;
  };

  service.getAllPropertiesForPage = function(site, page) {
    var result = [];
    for (var j in fns) {
      var propertyValue = fns[j].fn(page, site);
      result.push({title: fns[j].title, value: propertyValue});
    }
    return result;
  };

  return service;
}]);


text:
OPENTELEMETRY_BEGIN_NAMESPACE
namespace nostd
{
namespace detail
{
template <bool... Bs>
using all = std::is_same<integer_sequence<bool, true, Bs...>, integer_sequence<bool, Bs..., true>>;

}  // namespace detail
}  // namespace nostd
OPENTELEMETRY_END_NAMESPACE


text:
"""Support for aggregation-based AMG"""

__docformat__ = "restructuredtext en"

import numpy
import scipy
from scipy.sparse import isspmatrix_csr, isspmatrix_bsr

from pyamg.multilevel import multilevel_solver
from pyamg.util.utils import relaxation_as_linear_operator
from pyamg.relaxation.smoothing import change_smoothers
from pyamg.strength import symmetric_strength_of_connection, evolution_strength_of_connection, \
                           distance_strength_of_connection
from pyamg.aggregation.aggregation import extend_hierarchy, preprocess_Bimprove, \
                                        preprocess_str_or_agg, preprocess_smooth
from pyamg.aggregation.aggregate import standard_aggregation, lloyd_aggregation
from pyamg.aggregation.tentative import fit_candidates
from pyamg.aggregation.smooth import jacobi_prolongation_smoother, \
                    richardson_prolongation_smoother, energy_prolongation_smoother

__all__ = ['smoothed_aggregation_helmholtz_solver', 'planewaves']

def planewaves(X, Y, omega=1.0, angles=[0.0]):
    """
    Generate plane waves for use in SA applied to Helmholtz problems

    Parameters
    ----------

    X,Y : {array}
        Coordinate vectors
    omega : {float}
        Helmholtz wave number, Laplace(u) + omega^2 u = f
    angles : {list}
        List of angles in [0, 2 pi] from which to generate planewaves

    Returns
    -------
    Array of planewaves

    """

    L = 2*len(angles)
    dimen = max(X.shape)
    W = numpy.zeros((L, dimen),dtype=complex)

    if L == 0:
        W = W.T.copy()
        return W

    X = numpy.ravel(X)
    Y = numpy.ravel(Y)

    #Set other columns to plane waves
    counter = 0
    for angle in angles:
        K = (omega*numpy.cos(angle), omega*numpy.sin(angle))
        wave = numpy.exp(0 + 1.0j*K[0]*X + 1.0j*K[1]*Y)

        W[counter,:] = numpy.real(wave)
        W[counter+1,:] = numpy.imag(wave)
        counter += 2

    # write W row-wise for efficiency
    W = W.T.copy()
    return W

def preprocess_planewaves(planewaves, max_levels):
    # Helper function for smoothed_aggregation_solver.
    # Will extend planewaves to a length max_levels list, repeating
    # the final element of planewaves if necessary.

    if planewaves == None:
        planewaves = [None]
    if not isinstance(planewaves, list):
        raise ValueError("planewaves must be a list")
    elif len(planewaves) < max_levels:
            planewaves.extend([planewaves[-1] for i in range(max_levels-len(planewaves)) ])

    return planewaves

def unpack_arg(v):
    if isinstance(v,tuple):
        return v[0],v[1]
    else:
        return v,{}

def smoothed_aggregation_helmholtz_solver(A, planewaves, use_constant=(True, {'last_level':0}),
        symmetry='symmetric', strength='symmetric', aggregate='standard',
        smooth=('energy', {'krylov': 'gmres'}),
        presmoother=('gauss_seidel_nr',{'sweep':'symmetric'}),
        postsmoother=('gauss_seidel_nr',{'sweep':'symmetric'}),
        Bimprove='default', max_levels = 10, max_coarse = 100, **kwargs):

    """
    Create a multilevel solver using Smoothed Aggregation (SA) for a 2D Helmholtz operator

    Parameters
    ----------
    A : {csr_matrix, bsr_matrix}
        Sparse NxN matrix in CSR or BSR format
    planewaves : { list }
        [pw_0, pw_1, ..., pw_n], where the k-th tuple pw_k is of the form (fn,
        args).  fn is a callable and args is a dictionary of arguments for fn.
        This k-th tuple is used to define any new planewaves (i.e., new coarse
        grid basis functions) to be appended to the existing B_k at that level.
            The function fn must return functions defined on the finest level,
        i.e., a collection of vector(s) of length A.shape[0].  These vectors
        are then restricted to the appropriate level, where they enrich the
        coarse space.
            Instead of a tuple, None can be used to stipulate no introduction
        of planewaves at that level.  If len(planewaves) < max_levels, the
        last entry is used to define coarser level planewaves.
    use_constant : {tuple}
        Tuple of the form (bool, {'last_level':int}).  The boolean denotes
        whether to introduce the constant in B at level 0.  'last_level' denotes
        the final level to use the constant in B.  That is, if 'last_level' is 1,
        then the vector in B corresponding to the constant on level 0 is dropped
        from B at level 2.
            This is important, because using constant based interpolation beyond
        the Nyquist rate will result in poor solver performance.
    symmetry : {string}
        'symmetric' refers to both real and complex symmetric
        'hermitian' refers to both complex Hermitian and real Hermitian
        'nonsymmetric' i.e. nonsymmetric in a hermitian sense
        Note that for the strictly real case, symmetric and hermitian are the same
        Note that this flag does not denote definiteness of the operator.
    strength : ['symmetric', 'classical', 'evolution', ('predefined', {'C' : csr_matrix}), None]
        Method used to determine the strength of connection between unknowns of
        the linear system.  Method-specific parameters may be passed in using a
        tuple, e.g. strength=('symmetric',{'theta' : 0.25 }). If strength=None,
        all nonzero entries of the matrix are considered strong.
            See notes below for varying this parameter on a per level basis.  Also,
        see notes below for using a predefined strength matrix on each level.
    aggregate : ['standard', 'lloyd', 'naive', ('predefined', {'AggOp' : csr_matrix})]
        Method used to aggregate nodes.  See notes below for varying this
        parameter on a per level basis.  Also, see notes below for using a
        predefined aggregation on each level.
    smooth : ['jacobi', 'richardson', 'energy', None]
        Method used to smooth the tentative prolongator.  Method-specific
        parameters may be passed in using a tuple, e.g.  smooth=
        ('jacobi',{'filter' : True }).  See notes below for varying this
        parameter on a per level basis.
    presmoother : {tuple, string, list} : default ('block_gauss_seidel', {'sweep':'symmetric'})
        Defines the presmoother for the multilevel cycling.  The default block
        Gauss-Seidel option defaults to point-wise Gauss-Seidel, if the matrix
        is CSR or is a BSR matrix with blocksize of 1.  See notes below for
        varying this parameter on a per level basis.
    postsmoother : {tuple, string, list}
        Same as presmoother, except defines the postsmoother.
    Bimprove : {list} : default [('block_gauss_seidel', {'sweep':'symmetric'}), None]
        The ith entry defines the method used to improve the candidates B on
        level i.  If the list is shorter than max_levels, then the last entry
        will define the method for all levels lower.
            The list elements are relaxation descriptors of the form used for
        presmoother and postsmoother.  A value of None implies no action on B.
    max_levels : {integer} : default 10
        Maximum number of levels to be used in the multilevel solver.
    max_coarse : {integer} : default 500
        Maximum number of variables permitted on the coarse grid.

    Other Parameters
    ----------------
    coarse_solver : ['splu','lu', ... ]
        Solver used at the coarsest level of the MG hierarchy

    Returns
    -------
    ml : multilevel_solver
        Multigrid hierarchy of matrices and prolongation operators

    See Also
    --------
    multilevel_solver, smoothed_aggregation_solver

    Notes
    -----
    - The additional parameters are passed through as arguments to
      multilevel_solver.  Refer to pyamg.multilevel_solver for additional
      documentation.

    - The parameters smooth, strength, aggregate, presmoother, postsmoother can
      be varied on a per level basis.  For different methods on different
      levels, use a list as input so that the ith entry defines the method at
      the ith level.  If there are more levels in the hierarchy than list
      entries, the last entry will define the method for all levels lower.

      Examples are:
      smooth=[('jacobi', {'omega':1.0}), None, 'jacobi']
      presmoother=[('block_gauss_seidel', {'sweep':symmetric}), 'sor']
      aggregate=['standard', 'naive']
      strength=[('symmetric', {'theta':0.25}), ('symmetric',{'theta':0.08})]

    - Predefined strength of connection and aggregation schemes can be
      specified.  These options are best used together, but aggregation can be
      predefined while strength of connection is not.

      For predefined strength of connection, use a list consisting of tuples of
      the form ('predefined', {'C' : C0}), where C0 is a csr_matrix and each
      degree-of-freedom in C0 represents a supernode.  For instance to
      predefine a three-level hierarchy, use [('predefined', {'C' : C0}),
      ('predefined', {'C' : C1}) ].

      Similarly for predefined aggregation, use a list of tuples.  For instance
      to predefine a three-level hierarchy, use [('predefined', {'AggOp' :
      Agg0}), ('predefined', {'AggOp' : Agg1}) ], where the dimensions of A,
      Agg0 and Agg1 are compatible, i.e.  Agg0.shape[1] == A.shape[0] and
      Agg1.shape[1] == Agg0.shape[0].  Each AggOp is a csr_matrix.

    Examples
    --------
    >>> from pyamg import smoothed_aggregation_helmholtz_solver, poisson
    >>> from scipy.sparse.linalg import cg
    >>> from scipy import rand
    >>> A = poisson((100,100), format='csr')           # matrix
    >>> b = rand(A.shape[0])                           # random RHS
    >>> ml = smoothed_aggregation_solver(A)            # AMG solver
    >>> M = ml.aspreconditioner(cycle='V')             # preconditioner
    >>> x,info = cg(A, b, tol=1e-8, maxiter=30, M=M)   # solve with CG

    References
    ----------
    .. [1] L. N. Olson and J. B. Schroder. Smoothed Aggregation for Helmholtz
    Problems. Numerical Linear Algebra with Applications.  pp. 361--386.  17
    (2010).

    """
    if not (isspmatrix_csr(A) or isspmatrix_bsr(A)):
        raise TypeError('argument A must have type csr_matrix or bsr_matrix')

    A = A.asfptype()

    if (symmetry != 'symmetric') and (symmetry != 'hermitian') and (symmetry != 'nonsymmetric'):
        raise ValueError('expected \'symmetric\', \'nonsymmetric\' or \'hermitian\' for the symmetry parameter ')
    A.symmetry = symmetry

    if A.shape[0] != A.shape[1]:
        raise ValueError('expected square matrix')

    ##
    # Preprocess and extend planewaves to length max_levels
    planewaves = preprocess_planewaves(planewaves, max_levels)
    # Check that the user has defined functions for B at each level
    use_const, args = unpack_arg(use_constant)
    first_planewave_level = -1
    for pw in planewaves:
        first_planewave_level += 1
        if pw is not None:
            break
    ##
    if (use_const == False) and (planewaves[0] == None):
        raise ValueError('No functions defined for B on the finest level, ' + \
              'either use_constant must be true, or planewaves must be defined for level 0')
    elif (use_const == True) and (args['last_level'] < first_planewave_level-1):
        raise ValueError('Some levels have no function(s) defined for B.  ' + \
                         'Change use_constant and/or planewave arguments.')

    ##
    # Preprocess parameters
    max_levels, max_coarse, strength = preprocess_str_or_agg(strength, max_levels, max_coarse)
    max_levels, max_coarse, aggregate = preprocess_str_or_agg(aggregate, max_levels, max_coarse)
    Bimprove = preprocess_Bimprove(Bimprove, A, max_levels)
    smooth = preprocess_smooth(smooth, max_levels)

    ##
    # Start first level
    levels = []
    levels.append( multilevel_solver.level() )
    levels[-1].A = A                            # matrix
    levels[-1].B = numpy.zeros((A.shape[0],0))  # place-holder for near-nullspace candidates

    zeros_0 = numpy.zeros((levels[0].A.shape[0],), dtype=A.dtype)
    while len(levels) < max_levels and levels[-1].A.shape[0] > max_coarse:
        A = levels[0].A
        A_l = levels[-1].A
        zeros_l = numpy.zeros((levels[-1].A.shape[0],), dtype=A.dtype)

        ##
        # Generate additions to n-th level candidates
        if planewaves[len(levels)-1] != None:
            fn, args = unpack_arg(planewaves[len(levels)-1])
            Bcoarse2 = numpy.array(fn(**args))

            ##
            # As in alpha-SA, relax the candidates before restriction
            if Bimprove[0] is not None:
                Bcoarse2 = relaxation_as_linear_operator(Bimprove[0], A, zeros_0)*Bcoarse2

            ##
            # Restrict Bcoarse2 to current level
            for i in range(len(levels)-1):
                Bcoarse2 = levels[i].R*Bcoarse2
            # relax after restriction
            if Bimprove[len(levels)-1] is not None:
                Bcoarse2 =relaxation_as_linear_operator(Bimprove[len(levels)-1],A_l,zeros_l)*Bcoarse2
        else:
            Bcoarse2 = numpy.zeros((A_l.shape[0],0),dtype=A.dtype)

        ##
        # Deal with the use of constant in interpolation
        use_const, args = unpack_arg(use_constant)
        if use_const and len(levels) == 1:
            # If level 0, and the constant is to be used in interpolation
           levels[0].B = numpy.hstack( (numpy.ones((A.shape[0],1), dtype=A.dtype), Bcoarse2) )
        elif use_const and args['last_level'] == len(levels)-2:
            # If the previous level was the last level to use the constant, then remove the
            # coarse grid function based on the constant from B
            levels[-1].B = numpy.hstack( (levels[-1].B[:,1:], Bcoarse2) )
        else:
            levels[-1].B = numpy.hstack((levels[-1].B, Bcoarse2))

        ##
        # Create and Append new level
        extend_hierarchy(levels, strength, aggregate, smooth, [None for i in range(max_levels)] ,keep=True)

    ml = multilevel_solver(levels, **kwargs)
    change_smoothers(ml, presmoother, postsmoother)
    return ml


text:
import { asyncScheduler } from 'rxjs';
import { debounceTime as higherOrder } from 'rxjs/operators';
export function debounceTime(dueTime, scheduler = asyncScheduler) {
    return higherOrder(dueTime, scheduler)(this);
}
//# sourceMappingURL=debounceTime.js.map


text:
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

/**
 * @fileoverview
 * 'settings-router' is a simple router for settings. Its responsibilites:
 *  - Update the URL when the routing state changes.
 *  - Initialize the routing state with the initial URL.
 *  - Process and validate all routing state changes.
 *
 * Example:
 *
 *    <settings-router current-route="{{currentRoute}}">
 *    </settings-router>
 *
 * @group Chrome Settings Elements
 * @element settings-router
 */
Polymer({
  is: 'settings-router',

  properties: {
    /**
     * The current active route. This is reflected to the URL. Updates to this
     * property should replace the whole object.
     *
     * currentRoute.page refers to top-level pages such as Basic and Advanced.
     *
     * currentRoute.section is only non-empty when the user is on a subpage. If
     * the user is on Basic, for instance, this is an empty string.
     *
     * currentRoute.subpage is an Array. The last element is the actual subpage
     * the user is on. The previous elements are the ancestor subpages. This
     * enables support for multiple paths to the same subpage. This is used by
     * both the Back button and the Breadcrumb to determine ancestor subpages.
     */
    currentRoute: {
      notify: true,
      observer: 'currentRouteChanged_',
      type: Object,
      value: function() {
        // Take the current URL, find a matching pre-defined route, and
        // initialize the currentRoute to that pre-defined route.
        for (var i = 0; i < this.routes_.length; ++i) {
          var route = this.routes_[i];
          if (route.url == window.location.pathname) {
            return {
              page: route.page,
              section: route.section,
              subpage: route.subpage,
            };
          }
        }

        // As a fallback return the default route.
        return this.routes_[0];
      },
    },

    /**
     * Page titles for the currently active route. Updated by the currentRoute
     * property observer.
     * @type {{pageTitle: string, subpageTitles: Array<string>}}
     */
    currentRouteTitles: {
      notify: true,
      type: Object,
      value: function() { return {}; },
    },
  },

 /**
  * @private
  * The 'url' property is not accessible to other elements.
  */
 routes_: [
    {
      url: '/',
      page: 'basic',
      section: '',
      subpage: [],
      subpageTitles: [],
    },
    {
      url: '/advanced',
      page: 'advanced',
      section: '',
      subpage: [],
      subpageTitles: [],
    },
    {
      url: '/startup',
      page: 'basic',
      section: 'on-startup',
      subpage: ['startup-urls'],
      subpageTitles: ['onStartupSetPages'],
    },
    {
      url: '/searchEngines',
      page: 'basic',
      section: 'search',
      subpage: ['search-engines'],
      subpageTitles: ['searchEnginesPageTitle'],
    },
    {
      url: '/searchEngines/advanced',
      page: 'basic',
      section: 'search',
      subpage: ['search-engines', 'search-engines-advanced'],
      subpageTitles: ['searchEnginesPageTitle', 'advancedPageTitle'],
    },
    {
      url: '/certificates',
      page: 'advanced',
      section: 'privacy',
      subpage: ['manage-certificates'],
      subpageTitles: ['manageCertificates'],
    },
    {
      url: '/content',
      page: 'advanced',
      section: 'privacy',
      subpage: ['site-settings'],
      subpageTitles: ['siteSettings'],
    },
    {
      url: '/networkDetail',
      page: 'basic',
      section: 'internet',
      subpage: ['network-detail'],
      subpageTitles: ['internetDetailPageTitle'],
    },
    {
      url: '/knownNetworks',
      page: 'basic',
      section: 'internet',
      subpage: ['known-networks'],
      subpageTitles: ['internetKnownNetworksPageTitle'],
    },
  ],

  /**
   * Sets up a history popstate observer.
   */
  created: function() {
    window.addEventListener('popstate', function(event) {
      if (event.state && event.state.page)
        this.currentRoute = event.state;
    }.bind(this));
  },

  /**
   * @private
   * Is called when another element modifies the route. This observer validates
   * the route change against the pre-defined list of routes, and updates the
   * URL appropriately.
   */
  currentRouteChanged_: function(newRoute, oldRoute) {
    for (var i = 0; i < this.routes_.length; ++i) {
      var route = this.routes_[i];
      if (route.page == newRoute.page && route.section == newRoute.section &&
          route.subpage.length == newRoute.subpage.length &&
          newRoute.subpage.every(function(value, index) {
            return value == route.subpage[index];
          })) {

        // Update the property containing the titles for the current route.
        this.currentRouteTitles = {
          pageTitle: loadTimeData.getString(route.page + 'PageTitle'),
          subpageTitles: route.subpageTitles.map(function(titleCode) {
            return loadTimeData.getString(titleCode);
          }),
        };

        // If we are restoring a state from history, don't push it again.
        if (newRoute.inHistory)
          return;

        // Mark routes persisted in history as already stored in history.
        var historicState = {
          inHistory: true,
          page: newRoute.page,
          section: newRoute.section,
          subpage: newRoute.subpage,
        };

        // Push the current route to the history state, so when the user
        // navigates with the browser back button, we can recall the route.
        if (oldRoute) {
          history.pushState(historicState, null, route.url);
        } else {
          // For the very first route (oldRoute will be undefined), we replace
          // the existing state instead of pushing a new one. This is to allow
          // the user to use the browser back button to exit Settings entirely.
          history.replaceState(historicState, null);
        }

        return;
      }
    }

    assertNotReached('Route not found: ' + JSON.stringify(newRoute));
  },
});