text:
#ifndef _IAS_QS_Lang_SPS_SendAsyncRequest_H_
#define _IAS_QS_Lang_SPS_SendAsyncRequest_H_

#include <lang/interpreter/extern/Statement.h>
#include <lang/interpreter/exe/Context.h>

#include <qs/workers/proc/wcm/WorkContextManager.h>
#include <qs/workers/proc/logic/sps/ProcessCacheEntry.h>

namespace IAS {
namespace QS {
namespace Lang {
namespace SPS {

/*************************************************************************/
/** The SendAsyncRequest class.
 *
 */
class SendAsyncRequest : public ::IAS::Lang::Interpreter::Extern::Statement {
public:

	virtual ~SendAsyncRequest() throw();

	/** Creates an instance. */
	static Statement* Create(const DM::Type* pType, const StringList& lstParamaters, const ::IAS::Lang::Interpreter::Extern::ModuleProxy* pModuleProxy);

protected:
	virtual void executeExternal(::IAS::Lang::Interpreter::Exe::Context *pCtx) const;

	SendAsyncRequest(const DM::Type* pType, const StringList& lstParamaters, const ::IAS::Lang::Interpreter::Extern::ModuleProxy* pModuleProxy);

	ThreadSpecific<Workers::Proc::WCM::WorkContextManager>::Pointer  pWorkContext;

	ThreadSpecific<Workers::Proc::Logic::SPS::ProcessCacheEntry>::Pointer pProcessCacheEntry;

	friend class ::IAS::Factory<SendAsyncRequest>;
};

/*************************************************************************/
}
}
}
}

#endif /* _IAS_Lang_Interpreter_Extern_Std_SendAsyncRequest_H_ */


text:
#import <Foundation/Foundation.h>
#import "CCResponderManager.h"
#import "CCMacros.h"

/**
  CCResponder is the base class for all nodes.
  It exposes the touch and mouse interface to any node, which enables user interaction.
  It is somewhat similar to [UIResponder](https://developer.apple.com/library/IOs/documentation/UIKit/Reference/UIResponder_Class/index.html).

  To make a responder react to user interaction, the touchesXXX / mouseXXX event must be overridden in your node subclass.
  If a class does not implement these selectors, the event will be passed on to the next node in the Cocos2D responder chain.
  To force the events to be passed to next responder, call the super implementation before returning from the event.

 ### Subclassing Notes
 You should not create subclasses of CCResponder. Instead subclass from CCNode if you need a plain basic node, or other node classes that best fit the purpose.

 @note To handle touch events, the touchBegan method must always be overridden (implemented) in your node's subclass. It may remain empty.
 Otherwise the other touch events will not be received either if touchBegan is not implemented.

 */
@interface CCResponder : NSObject

/// -----------------------------------------------------------------------
/// @name Enabling Input Events
/// -----------------------------------------------------------------------

/** Enables user interaction on a node. */
@property ( nonatomic, assign, getter = isUserInteractionEnabled ) BOOL userInteractionEnabled;

/** Enables multiple touches inside a single node. */
@property ( nonatomic, assign, getter = isMultipleTouchEnabled ) BOOL multipleTouchEnabled;

/// -----------------------------------------------------------------------
/// @name Customize Event Behavior
/// -----------------------------------------------------------------------

/**
 *  Continues to send touch events to the node that received the initial touchBegan, even when the touch has subsequently moved outside the node.
 *
 *  If set to NO, touches will be cancelled if they move outside the node's area.
 *  And if touches begin outside the node but subsequently move onto the node, the node will receive the touchBegan event.
 */
@property (nonatomic, assign) BOOL claimsUserInteraction;

/**
 *  All other touches will be cancelled / ignored if a node with exclusive touch is active.
 *  Only one exclusive touch node can be active at a time.
 */
@property (nonatomic, assign, getter = isExclusiveTouch) BOOL exclusiveTouch;

/**
 *  Expands (or contracts) the hit area of the node.
 *  The expansion is calculated as a margin around the sprite, in points.
 */
@property (nonatomic, assign) float hitAreaExpansion;

// purposefully undocumented: CCResponder should not be instantiated by users
- (id)init;

/// -----------------------------------------------------------------------
/// @name Performing Hit Tests
/// -----------------------------------------------------------------------

/**
 *  Check if a touch is inside the node. To allow custom touch detection, override this method in your node subclass.
 *
 *  @param pos Position in scene (world) coordinates.
 *
 *  @return Returns true if the position is inside the node.
 */
- (BOOL)hitTestWithWorldPos:(CGPoint)pos;

#if (TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR)

#pragma mark -
#pragma mark Touch Handling Methods
/// -----------------------------------------------------------------------
/// @name Touch Handling Methods
/// -----------------------------------------------------------------------

/**
 Called when a touch began. Behavior notes:

 - If a touch is dragged inside a node which does not claim user interaction, a touchBegan event will be generated.
 - If node has exclusive touch, all other ongoing touches will be cancelled.
 - If a node wants to handle any touch event, the touchBegan method must be overridden in the node subclass. Overriding just touchMoved or touchEnded does not suffice.
 - To pass the touch further down the Cocos2D responder chain, call the super implementation, ie [super touchBegan:withEvent:].

 @param touch    Contains the touch.
 @param event    Current event information.
 @see CCTouch, CCTouchEvent
 */
- (void)touchBegan:(CCTouch *)touch withEvent:(CCTouchEvent *)event;

/**
 *  Called whan a touch moved.
 *
 *  @param touch    Contains the touch.
 *  @param event    Current event information.
 *  @see CCTouch, CCTouchEvent
 */
- (void)touchMoved:(CCTouch *)touch withEvent:(CCTouchEvent *)event;

/**
 *  Called when a touch ended.
 *
 *  @param touch    Contains the touch.
 *  @param event    Current event information.
 *  @see CCTouch, CCTouchEvent
 */
- (void)touchEnded:(CCTouch *)touch withEvent:(CCTouchEvent *)event;

/**
 *  Called when a touch was cancelled.
 *
 *  If a touch is dragged outside a node which does not claim user interaction, touchCancelled will be called.
 *  If another node with exclusive touch is activated, touchCancelled will be called for all ongoing touches.
 *
 *  @param touch    Contains the touch.
 *  @param event    Current event information.
 *  @see CCTouch, CCTouchEvent
 */
- (void)touchCancelled:(CCTouch *)touch withEvent:(CCTouchEvent *)event;

#elif __CC_PLATFORM_MAC

#pragma mark -
#pragma mark Mouse Handling Methods
/// -----------------------------------------------------------------------
/// @name Mouse Handling Methods
/// -----------------------------------------------------------------------

/**
 *  Called when left mouse button is pressed inside a node with userInteractionEnabled set to YES.
 *
 *  @param theEvent The event created.
 *  @see [NSEvent](https://developer.apple.com/library/mac/documentation/Cocoa/Reference/ApplicationKit/Classes/NSEvent_Class/)
 */
- (void)mouseDown:(NSEvent *)theEvent;

/**
 *  Called when left mouse button is held and mouse dragged for a node with userInteractionEnabled set to YES.
 *
 *  @param theEvent The event created.
 *  @see [NSEvent](https://developer.apple.com/library/mac/documentation/Cocoa/Reference/ApplicationKit/Classes/NSEvent_Class/)
 */
- (void)mouseDragged:(NSEvent *)theEvent;

/**
 *  Called when left mouse button is released for a node with userInteractionEnabled set to YES.
 *
 *  @param theEvent The event created.
 *  @see [NSEvent](https://developer.apple.com/library/mac/documentation/Cocoa/Reference/ApplicationKit/Classes/NSEvent_Class/)
 */
- (void)mouseUp:(NSEvent *)theEvent;

/**
 *  Called when right mouse button is pressed inside a node with userInteractionEnabled set to YES.
 *
 *  @param theEvent The event created.
 *  @see [NSEvent](https://developer.apple.com/library/mac/documentation/Cocoa/Reference/ApplicationKit/Classes/NSEvent_Class/)
 */
- (void)rightMouseDown:(NSEvent *)theEvent;

/**
 *  Called when right mouse button is held and mouse dragged for a node with userInteractionEnabled set to YES.
 *
 *  @param theEvent The event created.
 *  @see [NSEvent](https://developer.apple.com/library/mac/documentation/Cocoa/Reference/ApplicationKit/Classes/NSEvent_Class/)
 */
- (void)rightMouseDragged:(NSEvent *)theEvent;

/**
 *  Called when right mouse button is released for a node with userInteractionEnabled set to YES.
 *
 *  @param theEvent The event created.
 *  @see [NSEvent](https://developer.apple.com/library/mac/documentation/Cocoa/Reference/ApplicationKit/Classes/NSEvent_Class/)
 */
- (void)rightMouseUp:(NSEvent *)theEvent;

/**
 *  Called when middle mouse button is pressed inside a node with userInteractionEnabled set to YES.
 *
 *  @param theEvent The event created.
 *  @see [NSEvent](https://developer.apple.com/library/mac/documentation/Cocoa/Reference/ApplicationKit/Classes/NSEvent_Class/)
 */
- (void)otherMouseDown:(NSEvent *)theEvent;

/**
 *  Called when middle mouse button is held and mouse dragged for a node with userInteractionEnabled set to YES.
 *
 *  @param theEvent The event created.
 *  @see [NSEvent](https://developer.apple.com/library/mac/documentation/Cocoa/Reference/ApplicationKit/Classes/NSEvent_Class/)
 */
- (void)otherMouseDragged:(NSEvent *)theEvent;

/**
 *  Called when middle mouse button is released for a node with userInteractionEnabled set to YES.
 *
 *  @param theEvent The event created.
 *  @see [NSEvent](https://developer.apple.com/library/mac/documentation/Cocoa/Reference/ApplicationKit/Classes/NSEvent_Class/)
 */
- (void)otherMouseUp:(NSEvent *)theEvent;

/**
 *  Called when scroll wheel moved while mouse cursor is inside a node with userInteractionEnabled set to YES.
 *
 *  @param theEvent The event created.
 *  @see [NSEvent](https://developer.apple.com/library/mac/documentation/Cocoa/Reference/ApplicationKit/Classes/NSEvent_Class/)
 */
- (void)scrollWheel:(NSEvent *)theEvent;

#endif

@end

redpajama_set_name: RedPajamaGithub


text:
<?php

declare(strict_types = 1);

namespace Telegram\Storage\Interfaces;

/**
 * Describes a storage service instance
 */
interface ITelegramStorageService extends ITelegramStorageHandler {
    /**
     * Push a storageHandler to the StorageService
     * @param \Telegram\Storage\Interfaces\ITelegramStorageHandler $storageHandler
     * @return mixed
     */
    public function pushStorageHandler(ITelegramStorageHandler $storageHandler);

    /**
     * pop a storageHandler from the StorageService
     * @return \Telegram\Storage\Interfaces\ITelegramStorageHandler
     */
    public function popStorageHandler() : ITelegramStorageHandler;
}


text:
"""
Description.
"""

__author__ = 'ZJlblDEHb'

import datetime
from sqlalchemy.orm.collections import InstrumentedList
from config import DATETIME_FORMAT

def form_output(data, keys):
    if isinstance(data, (list, tuple)):
        return generate_objects_list(data, keys)

    else:
        return generate_single_object(data, keys)

def generate_objects_list(objects, keys):
    output = []
    for next_object in objects:
        output.append(generate_single_object(next_object, keys))
    return output

def generate_single_object(single_object, keys):
    output = {}
    for key in keys:
        attr = getattr(single_object, key)
        if isinstance(attr, InstrumentedList):
            output[key] = [element.id for element in attr]

        elif isinstance(attr, datetime.datetime):
            output[key] = attr.strftime(DATETIME_FORMAT)
        else:
            output[key] = attr

    return output


text:
<?php

namespace Faker\Provider\pt_BR;

class Address extends \Faker\Provider\Address
{
    protected static $cityPrefix = array('São', 'Porto', 'Vila', 'Santa');
    protected static $citySuffix = array('do Norte', 'do Leste', 'do Sul', 'd\'Oeste');
    protected static $streetPrefix = array(
        'Av.', 'Avenida', 'R.', 'Rua', 'Travessa', 'Largo'
    );
    protected static $buildingNumber = array('#####', '####', '###', '##', '#');
    protected static $postcode = array('#####-###');
    protected static $state = array(
        'Acre', 'Alagoas', 'Amapá', 'Amazonas', 'Bahia', 'Ceará',
        'Distrito Federal', 'Espírito Santo', 'Goiás', 'Maranhão',
        'Mato Grosso', 'Mato Grosso do Sul', 'Minas Gerais', 'Pará', 'Paraíba',
        'Paraná', 'Pernambuco', 'Piauí', 'Rio de Janeiro',
        'Rio Grande do Norte', 'Rio Grande do Sul', 'Rondônia', 'Roraima',
        'Santa Catarina', 'São Paulo', 'Sergipe', 'Tocantins'
    );
    protected static $stateAbbr = array(
        'AC', 'AL', 'AP', 'AM', 'BA', 'CE', 'DF', 'ES', 'GO', 'MA', 'MT', 'MS',
        'MG', 'PA', 'PB', 'PR', 'PE', 'PI', 'RJ', 'RN', 'RS', 'RO', 'RR', 'SC',
        'SP', 'SE', 'TO'
    );
    protected static $region = array(
        'Centro-Oeste', 'Nordeste', 'Norte', 'Sudeste', 'Sul'
    );
    protected static $regionAbbr = array(
        'CO', 'N', 'NE', 'SE', 'S'
    );
    protected static $country = array(
        'Afeganistão', 'África do Sul', 'Albânia', 'Alemanha', 'Andorra',
        'Angola', 'Antigua e Barbuda', 'Arabia Saudita', 'Argélia',
        'Argentina', 'Armênia', 'Austrália', 'Áustria', 'Azerbaijão',
        'Bahamas', 'Bangladesh', 'Barbados', 'Barein', 'Belize', 'Benin',
        'Bielorrússia', 'Birmânia', 'Bolívia', 'Bósnia e Herzegovina',
        'Botsuana', 'Brasil', 'Brunei', 'Bulgária', 'Burkina Faso',
        'Burundi', 'Butão', 'Bélgica', 'Cabo Verde', 'Camboja', 'Camarões',
        'Canadá', 'Cazaquistão', 'Chad', 'Chile', 'China', 'Chipre',
        'Colômbia', 'Comoras', 'Congo', 'Coréia do Norte', 'Coréia do Sul',
        'Costa Rica', 'Costa do Marfim', 'Croácia', 'Cuba', 'Dinamarca',
        'Djibouti', 'Domênica', 'Equador', 'Egito', 'El Salvador',
        'Emirados Árabes Unidos', 'Eritrea', 'Eslováquia', 'Eslovênia',
        'Espanha', 'Estados Unidos da América', 'Estônia', 'Etiópia',
        'Filipinas', 'Finlândia', 'Fiji','França', 'Gabão', 'Gâmbia',
        'Georgia', 'Gana', 'Granada', 'Grécia', 'Guatemala',
        'Guiné Equatorial', 'Guiné Bissau', 'Guiana', 'Haiti', 'Honduras',
        'Hungria', 'Índia', 'Indonésia', 'Iraque', 'Irlanda', 'Irã',
        'Islândia', 'Ilhas Marshall', 'Ilhas Maurício', 'Ilhas Salomão',
        'Ilhas Samoa', 'Israel', 'Itália', 'Jamaica', 'Japão', 'Jordânia',
        'Kiribati', 'Kwait', 'Laos', 'Lesoto', 'Letônia', 'Libéria', 'Líbia',
        'Liechtenstein', 'Lituânia', 'Luxemburgo', 'Líbano', 'Macedônia',
        'Madagascar', 'Malásia', 'Malauí', 'Maldivas', 'Mali', 'Malta',
        'Marrocos', 'Mauritânia', 'Micronésia', 'Moldávia', 'Mongólia',
        'Montenegro', 'Moçambique', 'México', 'Mônaco', 'Namíbia', 'Nauru',
        'Nepal', 'Nicarágua', 'Nigéria', 'Noruega', 'Nova Guiné',
        'Nova Zelândia', 'Níger', 'Omã', 'Qatar', 'Quênia','Quirguistão',
        'Paquistão', 'Palaos', 'Panamá', 'Papua Nova Guiné', 'Paraguai',
        'Países Baixos', 'Peru', 'Polônia', 'Portugal', 'Reino Unido',
        'Reino Unido da Grã Bretanha e Irlanda do Norte',
        'República Centroafricana', 'República Checa',
        'República Democrática do Congo', 'República Dominicana', 'Ruanda',
        'Romênia', 'Rússia', 'San Cristõvao e Neves', 'San Marino',
        'São Vicente e as Granadinas', 'Santa Luzia', 'São Tomé e Príncipe',
        'Senegal', 'Sérvia', 'Seychelles', 'Serra Leoa', 'Singapura', 'Síria',
        'Somália', 'Sri Lanka', 'Suazilândia', 'Sudão', 'Suécia', 'Suiça',
        'Suriname', 'Tailândia', 'Tanzânia', 'Tajiquistão', 'Timor Leste',
        'Togo', 'Tonga', 'Trinidad e Tobago', 'Turcomenistão', 'Turquia',
        'Tuvalu', 'Tunísia', 'Ucrânia', 'Uganda', 'Uruguai', 'Uzbequistão',
        'Vaticano', 'Vanuatu', 'Venezuela', 'Vietnã', 'Yemen', 'Zâmbia',
        'Zimbábue'
    );
    protected static $cityFormats = array(
        '{{cityPrefix}} {{firstName}} {{citySuffix}}',
        '{{cityPrefix}} {{firstName}}',
        '{{firstName}} {{citySuffix}}',
        '{{lastName}} {{citySuffix}}',
    );
    protected static $streetNameFormats = array(
        '{{streetPrefix}} {{firstName}}',
        '{{streetPrefix}} {{lastName}}',
        '{{streetPrefix}} {{firstName}} {{lastName}}'
    );
    protected static $streetAddressFormats = array(
        '{{streetName}}, {{buildingNumber}}',
        '{{streetName}}, {{buildingNumber}}. {{secondaryAddress}}',
    );
    protected static $addressFormats = array(
        "{{postcode}}, {{streetAddress}}\n{{city}} - {{stateAbbr}}",
    );
    protected static $secondaryAddressFormats = array(
        'Bloco A', 'Bloco B', 'Bloco C', 'Bc. # Ap. ##', 'Bc. ## Ap. ##',
        '#º Andar', '##º Andar', '###º Andar', 'Apto #', 'Apto ##', 'Apto ###',
        'Apto ####', 'F', 'Fundos', 'Anexo'
    );

    /**
     * @example 'Avenida'
     */
    public static function streetPrefix()
    {
        return static::randomElement(static::$streetPrefix);
    }

    /**
     * @example 'São'
     */
    public static function cityPrefix()
    {
        return static::randomElement(static::$cityPrefix);
    }

    /**
     * @example '6º Andar'
     */
    public static function secondaryAddress()
    {
        return static::numerify(static::randomElement(static::$secondaryAddressFormats));
    }

    /**
     * @example 'Brasília'
     */
    public static function state()
    {
        return static::randomElement(static::$state);
    }

    /**
     * @example 'DF'
     */
    public static function stateAbbr()
    {
        return static::randomElement(static::$stateAbbr);
    }

    /**
     * @example 'Nordeste'
     */
    public static function region()
    {
        return static::randomElement(static::$region);
    }

    /**
     * @example 'NE'
     */
    public static function regionAbbr()
    {
        return static::randomElement(static::$regionAbbr);
    }
}


text:
extern int weak_symbol __attribute__ ((weak));
int weak_symbol = 1;

// Define a strong symbol with a weak alias.

int strong_aliased = 2;
extern int weak_aliased __attribute__ ((weak, alias ("strong_aliased")));

// And another one.

int strong_aliased_2 = 5;
extern int weak_aliased_2 __attribute__ ((weak, alias ("strong_aliased_2")));

// And a third.

int strong_aliased_3 = 7;
extern int weak_aliased_3 __attribute__ ((weak, alias ("strong_aliased_3")));

// And a fourth.

int strong_aliased_4 = 8;
extern int weak_aliased_4 __attribute__ ((weak, alias ("strong_aliased_4")));

// We want a symbol whose name is the same length as "strong_symbol",
// so that weak_symbol here lines up with weak_symbol in
// weak_alias_test_2.so.

int Strong_Symbol = 101;


text:
	color:#ffffff;
	background-color:#292929;
}


text:
#import <Foundation/Foundation.h>
#import "SNSListTopicsResponse.h"
#import "SNSResponseUnmarshaller.h"
#ifdef AWS_MULTI_FRAMEWORK
#import <AWSRuntime/AmazonValueUnmarshaller.h>
#import <AWSRuntime/AmazonBoolValueUnmarshaller.h>
#else
#import "../AmazonValueUnmarshaller.h"
#import "../AmazonBoolValueUnmarshaller.h"
#endif

#ifdef AWS_MULTI_FRAMEWORK
#import <AWSRuntime/AmazonListUnmarshaller.h>
#else
#import "../AmazonListUnmarshaller.h"
#endif
#import "SNSTopicUnmarshaller.h"

/**
 * List Topics Result Unmarshaller
 */
@interface SNSListTopicsResponseUnmarshaller:SNSResponseUnmarshaller {
    SNSListTopicsResponse *response;
}

@property (nonatomic, readonly) SNSListTopicsResponse *response;

-(void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName attributes:(NSDictionary *)attributeDict;
-(void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName;

@end


text:
package uk.ac.ebi.pride.archive.web.util.filter;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import uk.ac.ebi.pride.archive.repo.param.service.CvParamSummary;
import uk.ac.ebi.pride.archive.repo.project.service.ProjectSummary;

import java.util.ArrayList;
import java.util.Collection;

/**
 * Filter and remove duplicated cv params from project
 *
 * @author Rui Wang
 * @version $Id$
 */
@Component
public class RemoveProjectDuplicateCvParamFilter implements EntityFilter<ProjectSummary>{

    private EntityFilter<CvParamSummary> removeDuplicateNameCvParamFilter;

    @Autowired
    public RemoveProjectDuplicateCvParamFilter(EntityFilter<CvParamSummary> removeDuplicateNameCvParamFilter) {
        this.removeDuplicateNameCvParamFilter = removeDuplicateNameCvParamFilter;
    }

    @Override
    public Collection<ProjectSummary> filter(Collection<ProjectSummary> entities) {
        Collection<ProjectSummary> projectSummaries = new ArrayList<ProjectSummary>();

        for (ProjectSummary entity : entities) {
            ProjectSummary filteredEntity = filterIndividualProjectSummary(entity);
            projectSummaries.add(filteredEntity);
        }

        return projectSummaries;
    }

    private ProjectSummary filterIndividualProjectSummary(ProjectSummary projectSummary) {
        // instruments
        Collection<CvParamSummary> filteredInstruments = removeDuplicateNameCvParamFilter.filter(projectSummary.getInstruments());
        projectSummary.setInstruments(filteredInstruments);

        // modification
        Collection<CvParamSummary> filteredModifications = removeDuplicateNameCvParamFilter.filter(projectSummary.getPtms());
        projectSummary.setPtms(filteredModifications);

        // samples
        Collection<CvParamSummary> filteredSamples = removeDuplicateNameCvParamFilter.filter(projectSummary.getSamples());
        projectSummary.setSamples(filteredSamples);

        // quatification
        Collection<CvParamSummary> filteredQuantifications = removeDuplicateNameCvParamFilter.filter(projectSummary.getQuantificationMethods());
        projectSummary.setQuantificationMethods(filteredQuantifications);

        return projectSummary;
    }
}


text:
package com.dremio.exec.store.dfs;

import java.util.List;

import javax.inject.Provider;
import javax.validation.constraints.NotBlank;

import com.dremio.exec.catalog.StoragePluginId;
import com.dremio.exec.catalog.conf.DefaultCtasFormatSelection;
import com.dremio.exec.catalog.conf.DisplayMetadata;
import com.dremio.exec.catalog.conf.NotMetadataImpacting;
import com.dremio.exec.catalog.conf.Property;
import com.dremio.exec.catalog.conf.SourceType;
import com.dremio.exec.server.SabotContext;
import com.dremio.io.file.Path;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.google.common.base.Preconditions;
import com.google.common.collect.Lists;

import io.protostuff.Tag;

@SourceType(value = "MAPRFS", label = "MapR-FS", uiConfig = "mapr-fs-layout.json")
public class MapRConf extends FileSystemConf<MapRConf, FileSystemPlugin<MapRConf>> {

  //  optional string cluster_name = 1;
  //  optional bool enableImpersonation = 2 [default = false];
  //  optional bool secure = 3;
  //  repeated Property property = 4;
  //  optional string root_path = 5 [default = "/"];
  //  optional bool allowCreateDrop = 6;

  @NotBlank
  @Tag(1)
  @DisplayMetadata(label = "Cluster Name")
  public String clusterName;

  @Tag(2)
  @DisplayMetadata(label = "Enable impersonation")
  public boolean enableImpersonation = false;

  @Tag(3)
  @DisplayMetadata(label = "Encrypt connection")
  public boolean secure = false;

  @Tag(4)
  @NotMetadataImpacting
  public List<Property> propertyList = Lists.newArrayList();

  @Tag(5)
  @DisplayMetadata(label = "Root Path")
  public String rootPath = "/";

  @Tag(6)
  @NotMetadataImpacting
  @DisplayMetadata(label = "Enable exports into the source (CTAS and DROP)")
  @JsonIgnore
  public boolean allowCreateDrop;

  @Tag(7)
  @NotMetadataImpacting
  @DisplayMetadata(label = "Default CTAS Format")
  public DefaultCtasFormatSelection defaultCtasFormat = DefaultCtasFormatSelection.ICEBERG;

  @Tag(10)
  @NotMetadataImpacting
  @DisplayMetadata(label = "Enable partition column inference")
  public boolean isPartitionInferenceEnabled = false;

  @Override
  public Path getPath() {
    return Path.of(rootPath);
  }

  @Override
  public boolean isImpersonationEnabled() {
    return enableImpersonation;
  }

  @Override
  public List<Property> getProperties() {
    return propertyList;
  }

  @Override
  public boolean isPartitionInferenceEnabled() {
    return isPartitionInferenceEnabled;
  }

  @Override
  public String getConnection() {
    Preconditions.checkNotNull(clusterName);
    return "maprfs://" + clusterName + "/";
  }

  @Override
  public SchemaMutability getSchemaMutability() {
    return SchemaMutability.USER_TABLE;
  }

  @Override
  public FileSystemPlugin<MapRConf> newPlugin(SabotContext context, String name, Provider<StoragePluginId> pluginIdProvider) {
    return new FileSystemPlugin<>(this, context, name, pluginIdProvider);
  }

  @Override
  public String getDefaultCtasFormat() {
    return defaultCtasFormat.getDefaultCtasFormat();
  }

}


text:
package org.wso2.siddhi.extension.string;

import junit.framework.Assert;
import org.apache.log4j.Logger;
import org.junit.Before;
import org.junit.Test;
import org.wso2.siddhi.core.ExecutionPlanRuntime;
import org.wso2.siddhi.core.SiddhiManager;
import org.wso2.siddhi.core.event.Event;
import org.wso2.siddhi.core.query.output.callback.QueryCallback;
import org.wso2.siddhi.core.stream.input.InputHandler;
import org.wso2.siddhi.core.util.EventPrinter;

public class StrcmpFunctionExtensionTestCase {
    static final Logger log = Logger.getLogger(StrcmpFunctionExtensionTestCase.class);
    private volatile int count;
    private volatile boolean eventArrived;

    @Before
    public void init() {
        count = 0;
        eventArrived = false;
    }

    @Test
    public void testStrcmpFunctionExtension1() throws InterruptedException {
        log.info("StrcmpFunctionExtension TestCase, with compareTo string being a constant.");
        SiddhiManager siddhiManager = new SiddhiManager();

        String inStreamDefinition = "@config(async = 'true')define stream inputStream (symbol string, price long, volume long);";
        String query = ("@info(name = 'query1') from inputStream select symbol , str:strcmp(symbol, 'Hello') as compareText " +
                "insert into outputStream;");
        ExecutionPlanRuntime executionPlanRuntime = siddhiManager.createExecutionPlanRuntime(inStreamDefinition + query);

        executionPlanRuntime.addCallback("query1", new QueryCallback() {
            @Override
            public void receive(long timeStamp, Event[] inEvents, Event[] removeEvents) {
                EventPrinter.print(timeStamp, inEvents, removeEvents);
                for (Event event : inEvents) {
                    count++;
                    if (count == 1) {
                        Assert.assertEquals(-7, event.getData(1));
                        eventArrived = true;
                    }
                    if (count == 2) {
                        Assert.assertEquals(-40, event.getData(1));
                        eventArrived = true;
                    }
                    if (count == 3) {
                        Assert.assertEquals(0, event.getData(1));
                        eventArrived = true;
                    }
                }
            }
        });

        InputHandler inputHandler = executionPlanRuntime.getInputHandler("inputStream");
        executionPlanRuntime.start();
        inputHandler.send(new Object[]{"AbCDefghiJ KLMN", 700f, 100l});
        inputHandler.send(new Object[]{" ertyut", 60.5f, 200l});
        inputHandler.send(new Object[]{"Hello", 60.5f, 200l});
        Thread.sleep(100);
        Assert.assertEquals(3, count);
        Assert.assertTrue(eventArrived);
        executionPlanRuntime.shutdown();
    }

    @Test
    public void testStrcmpFunctionExtension2() throws InterruptedException {
        log.info("StrcmpFunctionExtension TestCase, with compareTo string being a variable.");
        SiddhiManager siddhiManager = new SiddhiManager();

        String inStreamDefinition = "@config(async = 'true')define stream inputStream (symbol string, compareTo string, volume long);";
        String query = ("@info(name = 'query1') from inputStream select symbol , str:strcmp(symbol, compareTo) as compareText " +
                "insert into outputStream;");
        ExecutionPlanRuntime executionPlanRuntime = siddhiManager.createExecutionPlanRuntime(inStreamDefinition + query);

        executionPlanRuntime.addCallback("query1", new QueryCallback() {
            @Override
            public void receive(long timeStamp, Event[] inEvents, Event[] removeEvents) {
                EventPrinter.print(timeStamp, inEvents, removeEvents);
                for (Event event : inEvents) {
                    count++;
                    if (count == 1) {
                        Assert.assertEquals(-7, event.getData(1));
                        eventArrived = true;
                    }
                    if (count == 2) {
                        Assert.assertEquals(-40, event.getData(1));
                        eventArrived = true;
                    }
                    if (count == 3) {
                        Assert.assertEquals(0, event.getData(1));
                        eventArrived = true;
                    }
                }
            }
        });

        InputHandler inputHandler = executionPlanRuntime.getInputHandler("inputStream");
        executionPlanRuntime.start();
        inputHandler.send(new Object[]{"AbCDefsddghiJ KLMN", "Hello", 100l});
        inputHandler.send(new Object[]{" efdfdfrtyut", "Hertrlo", 200l});
        inputHandler.send(new Object[]{"Hello", "Hello", 200l});
        Thread.sleep(100);
        Assert.assertEquals(3, count);
        Assert.assertTrue(eventArrived);
        executionPlanRuntime.shutdown();
    }
}


text:
(function() {
	$().ready(

		function () {

			var $fixsearch=$('#fixBox')
			var $toUpButton=$("#toUpButton")
			var $userButton=$('.menubarUp .glyphicon-user')
			var $menubar=$('.menubar')
			var sideshow=false
			var $detailDivs=$(".detailDiv")
			var $floorgide=$(".floor-gide")
			// $menubar.hide()
			// console.log($userButton.innerHTML())
			window.addEventListener('scroll', function () {
				var stop=document.documentElement.scrollTop || document.body.scrollTop
				if(stop>800){
					$fixsearch.addClass('fixSearchBoxShow')
					$toUpButton.css('display','block')
					$floorgide.css("display" , 'block')
				}
				else{
					$fixsearch.removeClass('fixSearchBoxShow')
					$toUpButton.css("display",'none')
					$floorgide.css("display"  , "none")
				}
			}, false)

			//scroll to top
			$toUpButton.click(function () {
				var stop=document.documentElement.scrollTop || document.body.scrollTop
				var SPEED=stop/30
				var timer=setInterval(function () {
						if(document.documentElement.scrollTop){
							document.documentElement.scrollTop-=SPEED
							stop=document.documentElement.scrollTop || document.body.scrollTop
						}
						else{
							document.body.scrollTop-=SPEED
							stop=document.documentElement.scrollTop || document.body.scrollTop
						}
						if(stop==0){
							clearInterval(timer)
						}
						if(SPEED>400){
							console.log(SPEED)
							SPEED=SPEED/2
						}
					}, 1)
			})

			$menubar.bind('click',function(event) {
				var sourceElement=event.target||window.event.srcElement
				var sourceName=sourceElement.className
				if (sourceName=='glyphicon glyphicon-chevron-up') {
					return
				}
				else{
					$('.fixSidebar').addClass('fixSidebarShow')
					sideshow=true

					switch (sourceName) {
						case 'glyphicon glyphicon-user':
							for (var i = $detailDivs.length - 1; i >= 0; i--) {
								$detailDivs[i].className='detailDiv'
							}
							$('#user').addClass('detailDivShow')
							break;
						case 'glyphicon glyphicon-shopping-cart':
							for (var i = $detailDivs.length - 1; i >= 0; i--) {
								$detailDivs[i].className='detailDiv'
							}
							$('#shoppingCart').addClass('detailDivShow')
							break;
						case 'glyphicon glyphicon-heart-empty':
							for (var i = $detailDivs.length - 1; i >= 0; i--) {
								$detailDivs[i].className='detailDiv'
							}
							$('#heart').addClass('detailDivShow')
							break;
						case 'glyphicon glyphicon-map-marker':
							for (var i = $detailDivs.length - 1; i >= 0; i--) {
								$detailDivs[i].className='detailDiv'
							}
							$('#map').addClass('detailDivShow')
							break;
						case 'glyphicon glyphicon-bell':
							for (var i = $detailDivs.length - 1; i >= 0; i--) {
								$detailDivs[i].className='detailDiv'
							}
							$('#bell').addClass('detailDivShow')
							break;
						case 'glyphicon glyphicon-edit':
							for (var i = $detailDivs.length - 1; i >= 0; i--) {
								$detailDivs[i].className='detailDiv'
							}
							$('#edit').addClass('detailDivShow')
							break;

						default:

							break;
					}
				}
			})

			// $('body').bind('click',function  () {
			// 	var sourceElement=event.currentTarget||window.event.srcElement
			// 	// if (sourceElement.className=='fixSidebar') {
			// 	// 	return
			// 	// 	console.log('123')
			// 	// }
			// 	// else{
			// 	// 	$('.fixSidebar').removeClass('fixSidebarShow')
			// 	// 	console.log('456')
			// 	// 	console.log(sourceElement.className+"789")
			// 	// }
			// 	if (sideshow) {
			// 		$('.fixSidebar').removeClass('fixSidebarShow')
			// 		sideshow=false
			// 		console.log('close')
			// 	}
			// })
			$('.removeIcon').bind('click',function () {
				$('.fixSidebar').removeClass('fixSidebarShow')
			})

		}
		)
})()


text:
<?php

namespace Irradiate\Database\Eloquent;

use Illuminate\Database\Eloquent\Builder as BaseBuilder;
use Irradiate\Database\Query\Builder as QueryBuilder;

/**
 * Extended Eloquent builder.
 *
 * @author    Bogdan Ghervan <bogdan.ghervan@gmail.com>
 * @package   Irradiate\Database\Query
 */
class Builder extends BaseBuilder
{
	/**
	 * Creates a new Eloquent query builder instance.
	 *
	 * @param  \Irradiate\Database\Query\Builder $query
	 * @return void
	 */
	public function __construct(QueryBuilder $query)
	{
		parent::__construct($query);
	}

	/**
	 * Chunk the results of the query, but take no more than $limit.
     *
     * This method operates in a similar fashion to
     * {@link \Illuminate\Database\Eloquent\Builder::chunk}, but additionally
     * takes the $limit parameter to cap the total number of items
     * processed.
     *
     * The processing is handled in $callback.
	 *
	 * @param  int $chunkSize
	 * @param  int $limit
	 * @param  callable $callback
	 * @return void
	 */
    public function chunkWithLimit($chunkSize, $limit, callable $callback)
    {
        $chunkSize = min($chunkSize, $limit);
        $perPage   = $chunkSize;
        $page      = 1;

        $results = $this->take($chunkSize)->get();

        while (count($results)) {
			// On each chunk result set, we will pass them to the callback and then let the
			// developer take care of everything within the callback, which allows us to
			// keep the memory low for spinning through large result sets for working.
			if (call_user_func($callback, $results) === false) {
				break;
			}

            $page++;
            $limit -= $chunkSize;

            $chunkSize = min($chunkSize, $limit);
            if (!$chunkSize) {
                break;
            }

            $results = $this->skip(($page - 1) * $perPage)->take($chunkSize)->get();
        }
    }
}


text:
package gov.samhsa.consent2share.service.reference;

import gov.samhsa.consent2share.service.dto.LookupDto;

import java.util.List;

/**
 * The Interface AdministrativeGenderCodeService.
 */
public interface AdministrativeGenderCodeService {

	/**
	 * Find all administrative gender codes.
	 *
	 * @return the list
	 */
	List<LookupDto> findAllAdministrativeGenderCodes();
}


text:
package org.zalando.problem.spring.web.autoconfigure.security;

import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.web.servlet.MockMvc;

import static org.hamcrest.Matchers.is;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;

@SpringBootTest
@AutoConfigureMockMvc
@DirtiesContext
final class SecurityTest {
    @Autowired
    private MockMvc mockMvc;

    @Test
    void shouldConfigureExceptionHandling() throws Exception{
        mockMvc.perform(get("/not-exists-url"))
                .andExpect(status().isUnauthorized())
                .andExpect(jsonPath("$.status", is(401)))
                .andExpect(jsonPath("$.title", is("Unauthorized")))
                .andExpect(jsonPath("$.detail", is("Full authentication is required to access this resource")));
    }

    @SpringBootApplication
    static class TestApp {
        @Configuration(proxyBeanMethods = false)
        class WebSecurityConfig extends WebSecurityConfigurerAdapter {
            @Override
            protected void configure(HttpSecurity http) throws Exception {
                http.authorizeRequests().anyRequest().authenticated();
            }
        }
    }
}


text:
<?php

declare(strict_types=1);

namespace Sylius\Component\Core\Repository;

use Doctrine\ORM\QueryBuilder;
use Sylius\Component\Core\Model\TaxonInterface;
use Sylius\Component\Product\Repository\ProductVariantRepositoryInterface as BaseProductVariantRepositoryInterface;

interface ProductVariantRepositoryInterface extends BaseProductVariantRepositoryInterface
{
    public function createInventoryListQueryBuilder(string $locale): QueryBuilder;

    public function findByTaxon(TaxonInterface $taxon): array;
}


text:
---
uid: SolidEdgeFramework.TextCharStyle.Color
summary:
remarks: The color is stored as a long integer and is created with the RGB function (red, green, and blue color intensities) or as an integer between 0 and 16 that represents standard colors.
---


text:
class ActionManagerTest: public BaseTest
{
protected:
    TextureAtlas* _atlas;

    std::string    _title;

public:
    ActionManagerTest(void);
    ~ActionManagerTest(void);

    virtual std::string title() const override;
    virtual std::string subtitle() const override;
    void restartCallback(Ref* sender);
    void nextCallback(Ref* sender);
    void backCallback(Ref* sender);
};

class CrashTest : public ActionManagerTest
{
public:
    virtual std::string subtitle() const override;
    virtual void onEnter() override;
    void removeThis();
};

class LogicTest : public ActionManagerTest
{
public:
    virtual std::string subtitle() const override;
    virtual void onEnter() override;
    void bugMe(Node* node);
};

class PauseTest : public ActionManagerTest
{
public:
    virtual std::string subtitle() const override;
    virtual void onEnter() override;
    void unpause(float dt);
};

class StopActionTest : public ActionManagerTest
{
public:
    virtual std::string subtitle() const override;
    virtual void onEnter() override;
    void stopAction();
};

class ResumeTest : public ActionManagerTest
{
public:
    virtual std::string subtitle() const override;
    virtual void onEnter() override;
    void resumeGrossini(float time);
};

class ActionManagerTestScene : public TestScene
{
public:
    virtual void runThisTest();
};

#endif


text:
// Copyright (c) 2012 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.

#include "device/bluetooth/bluetooth_adapter.h"

#include <memory>
#include <string>
#include <utility>

#include "base/bind.h"
#include "base/callback_helpers.h"
#include "base/logging.h"
#include "base/memory/ptr_util.h"
#include "base/metrics/histogram_macros.h"
#include "base/task/single_thread_task_runner.h"
#include "build/build_config.h"
#include "components/device_event_log/device_event_log.h"
#include "device/bluetooth/bluetooth_common.h"
#include "device/bluetooth/bluetooth_device.h"
#include "device/bluetooth/bluetooth_discovery_session.h"
#include "device/bluetooth/bluetooth_discovery_session_outcome.h"
#include "device/bluetooth/bluetooth_remote_gatt_characteristic.h"
#include "device/bluetooth/bluetooth_remote_gatt_descriptor.h"
#include "device/bluetooth/bluetooth_remote_gatt_service.h"
#include "device/bluetooth/public/cpp/bluetooth_address.h"

namespace device {

BluetoothAdapter::ServiceOptions::ServiceOptions() = default;
BluetoothAdapter::ServiceOptions::~ServiceOptions() = default;

#if !defined(OS_ANDROID) && !defined(OS_CHROMEOS) && !defined(OS_MAC) && \
    !defined(OS_WIN) && !defined(OS_LINUX)
// static
scoped_refptr<BluetoothAdapter> BluetoothAdapter::CreateAdapter() {
  return nullptr;
}
#endif  // Not supported platforms.

base::WeakPtr<BluetoothAdapter> BluetoothAdapter::GetWeakPtrForTesting() {
  return GetWeakPtr();
}

#if defined(OS_LINUX) || defined(OS_CHROMEOS)
void BluetoothAdapter::Shutdown() {
  NOTIMPLEMENTED();
}
#endif

void BluetoothAdapter::AddObserver(BluetoothAdapter::Observer* observer) {
  DCHECK(observer);
  observers_.AddObserver(observer);
}

void BluetoothAdapter::RemoveObserver(BluetoothAdapter::Observer* observer) {
  DCHECK(observer);
  observers_.RemoveObserver(observer);
}

std::string BluetoothAdapter::GetSystemName() const {
  NOTIMPLEMENTED();
  return std::string();
}

bool BluetoothAdapter::HasObserver(BluetoothAdapter::Observer* observer) {
  DCHECK(observer);
  return observers_.HasObserver(observer);
}

bool BluetoothAdapter::CanPower() const {
  return IsPresent();
}

BluetoothAdapter::PermissionStatus BluetoothAdapter::GetOsPermissionStatus()
    const {
  // If this is not overridden that means OS permission is not
  // required on this platform so act as though we already have
  // permission.
  return PermissionStatus::kAllowed;
}

void BluetoothAdapter::SetPowered(bool powered,
                                  base::OnceClosure callback,
                                  ErrorCallback error_callback) {
  if (set_powered_callbacks_) {
    // Only allow one pending callback at a time.
    ui_task_runner_->PostTask(FROM_HERE, std::move(error_callback));
    return;
  }

  if (powered == IsPowered()) {
    // Return early in case no change of power state is needed.
    ui_task_runner_->PostTask(FROM_HERE, std::move(callback));
    return;
  }

  if (!SetPoweredImpl(powered)) {
    ui_task_runner_->PostTask(FROM_HERE, std::move(error_callback));
    return;
  }

  set_powered_callbacks_ = std::make_unique<SetPoweredCallbacks>();
  set_powered_callbacks_->powered = powered;
  set_powered_callbacks_->callback = std::move(callback);
  set_powered_callbacks_->error_callback = std::move(error_callback);
}

bool BluetoothAdapter::IsPeripheralRoleSupported() const {
  // TODO(crbug/1071595): Implement this for more platforms.
  return true;
}

std::unordered_map<BluetoothDevice*, BluetoothDevice::UUIDSet>
BluetoothAdapter::RetrieveGattConnectedDevicesWithDiscoveryFilter(
    const BluetoothDiscoveryFilter& discovery_filter) {
  return std::unordered_map<BluetoothDevice*, BluetoothDevice::UUIDSet>();
}

void BluetoothAdapter::StartDiscoverySession(const std::string& client_name,
                                             DiscoverySessionCallback callback,
                                             ErrorCallback error_callback) {
  StartDiscoverySessionWithFilter(nullptr, client_name, std::move(callback),
                                  std::move(error_callback));
}

void BluetoothAdapter::StartDiscoverySessionWithFilter(
    std::unique_ptr<BluetoothDiscoveryFilter> discovery_filter,
    const std::string& client_name,
    DiscoverySessionCallback callback,
    ErrorCallback error_callback) {
  if (!client_name.empty()) {
    BLUETOOTH_LOG(EVENT) << client_name
                         << " initiating Bluetooth discovery session";
  } else {
    BLUETOOTH_LOG(EVENT)
        << "Unknown client initiating Bluetooth discovery session";
  }

  std::unique_ptr<BluetoothDiscoverySession> new_session(
      new BluetoothDiscoverySession(this, std::move(discovery_filter)));
  discovery_sessions_.insert(new_session.get());

  auto new_session_callbacks = std::make_unique<StartOrStopDiscoveryCallback>(
      base::BindOnce(std::move(callback), std::move(new_session)),
      std::move(error_callback));

  // Queue up the callbacks to be handled when we process the discovery queue.
  discovery_callback_queue_.push(std::move(new_session_callbacks));

  // If OS is already working on a discovery request we must wait to process the
  // queue until that request is complete.
  if (discovery_request_pending_) {
    return;
  }

  // The OS is ready to start a request so process the queue now.
  ProcessDiscoveryQueue();
}

void BluetoothAdapter::MaybeUpdateFilter(
    std::unique_ptr<BluetoothDiscoveryFilter> discovery_filter,
    DiscoverySessionResultCallback callback) {
  if (discovery_filter->Equals(current_discovery_filter_)) {
    std::move(callback).Run(/*is_error=*/false,
                            UMABluetoothDiscoverySessionOutcome::SUCCESS);
    return;
  }

  UpdateFilter(std::move(discovery_filter), std::move(callback));
}

void BluetoothAdapter::RemoveDiscoverySession(
    BluetoothDiscoverySession* discovery_session,
    base::OnceClosure callback,
    DiscoverySessionErrorCallback error_callback) {
  size_t erased = discovery_sessions_.erase(discovery_session);
  DCHECK_EQ(1u, erased);

  auto removal_callbacks = std::make_unique<StartOrStopDiscoveryCallback>(
      std::move(callback), std::move(error_callback));

  // Queue up the callbacks to be handled when we process the discovery queue.
  discovery_callback_queue_.push(std::move(removal_callbacks));

  // If OS is already working on a discovery request we must wait to process the
  // queue until that request is complete.
  if (discovery_request_pending_) {
    return;
  }

  // The OS is ready to start a request so process the queue now.
  ProcessDiscoveryQueue();
}

std::unique_ptr<BluetoothDiscoveryFilter>
BluetoothAdapter::GetMergedDiscoveryFilter() const {
  auto result =
      std::make_unique<BluetoothDiscoveryFilter>(BLUETOOTH_TRANSPORT_DUAL);
  bool first_merge = true;

  for (auto* iter : discovery_sessions_) {
    if (!iter->IsActive())
      continue;

    const BluetoothDiscoveryFilter* curr_filter = iter->GetDiscoveryFilter();

    if (first_merge) {
      first_merge = false;
      if (curr_filter) {
        result->CopyFrom(*curr_filter);
      }
      continue;
    }
    result = BluetoothDiscoveryFilter::Merge(result.get(), curr_filter);
  }
  return result;
}

BluetoothAdapter::DeviceList BluetoothAdapter::GetDevices() {
  ConstDeviceList const_devices =
      const_cast<const BluetoothAdapter*>(this)->GetDevices();

  DeviceList devices;
  for (ConstDeviceList::const_iterator i = const_devices.begin();
       i != const_devices.end(); ++i)
    devices.push_back(const_cast<BluetoothDevice*>(*i));

  return devices;
}

BluetoothAdapter::ConstDeviceList BluetoothAdapter::GetDevices() const {
  ConstDeviceList devices;
  for (const auto& device : devices_)
    devices.push_back(device.second.get());

  return devices;
}

BluetoothDevice* BluetoothAdapter::GetDevice(const std::string& address) {
  return const_cast<BluetoothDevice*>(
      const_cast<const BluetoothAdapter*>(this)->GetDevice(address));
}

const BluetoothDevice* BluetoothAdapter::GetDevice(
    const std::string& address) const {
  std::string canonicalized_address = CanonicalizeBluetoothAddress(address);
  if (canonicalized_address.empty())
    return nullptr;

  auto iter = devices_.find(canonicalized_address);
  if (iter != devices_.end())
    return iter->second.get();

  return nullptr;
}

void BluetoothAdapter::AddPairingDelegate(
    BluetoothDevice::PairingDelegate* pairing_delegate,
    PairingDelegatePriority priority) {
  // Remove the delegate, if it already exists, before inserting to allow a
  // change of priority.
  RemovePairingDelegate(pairing_delegate);

  // Find the first point with a lower priority, or the end of the list.
  auto iter = pairing_delegates_.begin();
  while (iter != pairing_delegates_.end() && iter->second >= priority)
    ++iter;

  pairing_delegates_.insert(iter, std::make_pair(pairing_delegate, priority));
}

void BluetoothAdapter::RemovePairingDelegate(
    BluetoothDevice::PairingDelegate* pairing_delegate) {
  for (auto iter = pairing_delegates_.begin(); iter != pairing_delegates_.end();
       ++iter) {
    if (iter->first == pairing_delegate) {
      RemovePairingDelegateInternal(pairing_delegate);
      pairing_delegates_.erase(iter);
      return;
    }
  }
}

BluetoothDevice::PairingDelegate* BluetoothAdapter::DefaultPairingDelegate() {
  if (pairing_delegates_.empty())
    return NULL;

  return pairing_delegates_.front().first;
}

std::vector<BluetoothAdvertisement*>
BluetoothAdapter::GetPendingAdvertisementsForTesting() const {
  return {};
}

void BluetoothAdapter::NotifyAdapterPresentChanged(bool present) {
  for (auto& observer : observers_)
    observer.AdapterPresentChanged(this, present);
}

void BluetoothAdapter::NotifyAdapterPoweredChanged(bool powered) {
  for (auto& observer : observers_)
    observer.AdapterPoweredChanged(this, powered);
}

void BluetoothAdapter::NotifyDeviceChanged(BluetoothDevice* device) {
  DCHECK(device);
  DCHECK_EQ(device->GetAdapter(), this);

  for (auto& observer : observers_)
    observer.DeviceChanged(this, device);
}

void BluetoothAdapter::NotifyAdapterDiscoveryChangeCompletedForTesting() {
  for (auto& observer : observers_)
    observer.DiscoveryChangeCompletedForTesting();
}

#if defined(OS_CHROMEOS) || defined(OS_LINUX)
void BluetoothAdapter::NotifyDevicePairedChanged(BluetoothDevice* device,
                                                 bool new_paired_status) {
  for (auto& observer : observers_)
    observer.DevicePairedChanged(this, device, new_paired_status);
}
#endif

#if defined(OS_CHROMEOS) || defined(OS_LINUX)
void BluetoothAdapter::NotifyDeviceBatteryChanged(
    BluetoothDevice* device,
    BluetoothDevice::BatteryType type) {
  DCHECK_EQ(device->GetAdapter(), this);

  for (auto& observer : observers_) {
    observer.DeviceBatteryChanged(this, device, type);
  }
}
#endif

#if defined(OS_CHROMEOS)
void BluetoothAdapter::NotifyDeviceIsBlockedByPolicyChanged(
    BluetoothDevice* device,
    bool new_blocked_status) {
  DCHECK_EQ(device->GetAdapter(), this);

  for (auto& observer : observers_)
    observer.DeviceBlockedByPolicyChanged(this, device, new_blocked_status);
}
#endif

void BluetoothAdapter::NotifyGattServiceAdded(
    BluetoothRemoteGattService* service) {
  DCHECK_EQ(service->GetDevice()->GetAdapter(), this);

  for (auto& observer : observers_)
    observer.GattServiceAdded(this, service->GetDevice(), service);
}

void BluetoothAdapter::NotifyGattServiceRemoved(
    BluetoothRemoteGattService* service) {
  DCHECK_EQ(service->GetDevice()->GetAdapter(), this);

  for (auto& observer : observers_)
    observer.GattServiceRemoved(this, service->GetDevice(), service);
}

void BluetoothAdapter::NotifyGattServiceChanged(
    BluetoothRemoteGattService* service) {
  DCHECK_EQ(service->GetDevice()->GetAdapter(), this);

  for (auto& observer : observers_)
    observer.GattServiceChanged(this, service);
}

int BluetoothAdapter::NumDiscoverySessions() const {
  return discovery_sessions_.size();
}

int BluetoothAdapter::NumScanningDiscoverySessions() const {
  int count = 0;
  for (auto* session : discovery_sessions_) {
    if (session->status() ==
        BluetoothDiscoverySession::SessionStatus::SCANNING) {
      ++count;
    }
  }

  return count;
}

void BluetoothAdapter::NotifyGattServicesDiscovered(BluetoothDevice* device) {
  DCHECK(device->GetAdapter() == this);

  for (auto& observer : observers_)
    observer.GattServicesDiscovered(this, device);
}

void BluetoothAdapter::NotifyGattDiscoveryComplete(
    BluetoothRemoteGattService* service) {
  DCHECK_EQ(service->GetDevice()->GetAdapter(), this);

  for (auto& observer : observers_)
    observer.GattDiscoveryCompleteForService(this, service);
}

void BluetoothAdapter::NotifyGattCharacteristicAdded(
    BluetoothRemoteGattCharacteristic* characteristic) {
  DCHECK_EQ(characteristic->GetService()->GetDevice()->GetAdapter(), this);

  for (auto& observer : observers_)
    observer.GattCharacteristicAdded(this, characteristic);
}

void BluetoothAdapter::NotifyGattCharacteristicRemoved(
    BluetoothRemoteGattCharacteristic* characteristic) {
  DCHECK_EQ(characteristic->GetService()->GetDevice()->GetAdapter(), this);

  for (auto& observer : observers_)
    observer.GattCharacteristicRemoved(this, characteristic);
}

void BluetoothAdapter::NotifyGattDescriptorAdded(
    BluetoothRemoteGattDescriptor* descriptor) {
  DCHECK_EQ(
      descriptor->GetCharacteristic()->GetService()->GetDevice()->GetAdapter(),
      this);

  for (auto& observer : observers_)
    observer.GattDescriptorAdded(this, descriptor);
}

void BluetoothAdapter::NotifyGattDescriptorRemoved(
    BluetoothRemoteGattDescriptor* descriptor) {
  DCHECK_EQ(
      descriptor->GetCharacteristic()->GetService()->GetDevice()->GetAdapter(),
      this);

  for (auto& observer : observers_)
    observer.GattDescriptorRemoved(this, descriptor);
}

void BluetoothAdapter::NotifyGattCharacteristicValueChanged(
    BluetoothRemoteGattCharacteristic* characteristic,
    const std::vector<uint8_t>& value) {
  DCHECK_EQ(characteristic->GetService()->GetDevice()->GetAdapter(), this);

  base::WeakPtr<BluetoothRemoteGattCharacteristic> weak_characteristic =
      characteristic->GetWeakPtr();
  for (auto& observer : observers_) {
    if (!weak_characteristic)
      break;
    observer.GattCharacteristicValueChanged(this, characteristic, value);
  }
}

void BluetoothAdapter::NotifyGattDescriptorValueChanged(
    BluetoothRemoteGattDescriptor* descriptor,
    const std::vector<uint8_t>& value) {
  DCHECK_EQ(
      descriptor->GetCharacteristic()->GetService()->GetDevice()->GetAdapter(),
      this);

  for (auto& observer : observers_)
    observer.GattDescriptorValueChanged(this, descriptor, value);
}

BluetoothAdapter::SetPoweredCallbacks::SetPoweredCallbacks() = default;
BluetoothAdapter::SetPoweredCallbacks::~SetPoweredCallbacks() = default;

BluetoothAdapter::StartOrStopDiscoveryCallback::StartOrStopDiscoveryCallback(
    base::OnceClosure start_callback,
    ErrorCallback start_error_callback) {
  this->start_callback = std::move(start_callback);
  this->start_error_callback = std::move(start_error_callback);
}
BluetoothAdapter::StartOrStopDiscoveryCallback::StartOrStopDiscoveryCallback(
    base::OnceClosure stop_callback,
    DiscoverySessionErrorCallback stop_error_callback) {
  this->stop_callback = std::move(stop_callback);
  this->stop_error_callback = std::move(stop_error_callback);
}
BluetoothAdapter::StartOrStopDiscoveryCallback::
    ~StartOrStopDiscoveryCallback() = default;

BluetoothAdapter::BluetoothAdapter() {}

BluetoothAdapter::~BluetoothAdapter() {
  // If there's a pending powered request, run its error callback.
  if (set_powered_callbacks_)
    std::move(set_powered_callbacks_->error_callback).Run();
}

void BluetoothAdapter::RunPendingPowerCallbacks() {
  if (set_powered_callbacks_) {
    // Move into a local variable to clear out both callbacks at the end of the
    // scope and to allow scheduling another SetPowered() call in either of the
    // callbacks.
    auto callbacks = std::move(set_powered_callbacks_);
    callbacks->powered == IsPowered()
        ? std::move(callbacks->callback).Run()
        : std::move(callbacks->error_callback).Run();
  }
}

void BluetoothAdapter::OnDiscoveryChangeComplete(
    bool is_error,
    UMABluetoothDiscoverySessionOutcome outcome) {
  UpdateDiscoveryState(is_error);

  // Take a weak reference to |this| in case a callback frees the adapter.
  base::WeakPtr<BluetoothAdapter> self = GetWeakPtr();

  if (is_error) {
    NotifyDiscoveryError(std::move(callbacks_awaiting_response_));

    if (!self)
      return;

    discovery_request_pending_ = false;
    NotifyAdapterDiscoveryChangeCompletedForTesting();
    ProcessDiscoveryQueue();

    return;
  }

  // Inform BluetoothDiscoverySession that updates being processed have
  // completed.
  for (auto* session : discovery_sessions_)
    session->StartingSessionsScanning();

  current_discovery_filter_.CopyFrom(filter_being_set_);

  auto callbacks_awaiting_response = std::move(callbacks_awaiting_response_);
  while (!callbacks_awaiting_response.empty()) {
    std::unique_ptr<StartOrStopDiscoveryCallback> callbacks =
        std::move(callbacks_awaiting_response.front());
    callbacks_awaiting_response.pop();
    if (callbacks->start_callback)
      std::move(callbacks->start_callback).Run();
    if (callbacks->stop_callback)
      std::move(callbacks->stop_callback).Run();
  }

  if (!self)
    return;

  discovery_request_pending_ = false;
  NotifyAdapterDiscoveryChangeCompletedForTesting();
  ProcessDiscoveryQueue();
}

void BluetoothAdapter::UpdateDiscoveryState(bool is_error) {
  if (is_error) {
    if (internal_discovery_state_ == DiscoveryState::kStarting)
      internal_discovery_state_ = DiscoveryState::kIdle;
    // If there was an error stopping we still assume it worked as there is not
    // much we can do about the device messing up.
    if (internal_discovery_state_ == DiscoveryState::kStopping)
      internal_discovery_state_ = DiscoveryState::kIdle;
    return;
  }

  if (internal_discovery_state_ == DiscoveryState::kStarting)
    internal_discovery_state_ = DiscoveryState::kDiscovering;
  if (internal_discovery_state_ == DiscoveryState::kStopping)
    internal_discovery_state_ = DiscoveryState::kIdle;
}

void BluetoothAdapter::ProcessDiscoveryQueue() {
  if (discovery_callback_queue_.empty())
    return;
  DCHECK(callbacks_awaiting_response_.empty());
  callbacks_awaiting_response_.swap(discovery_callback_queue_);

  if (NumDiscoverySessions() == 0) {
    if (internal_discovery_state_ == DiscoveryState::kIdle) {
      OnDiscoveryChangeComplete(false,
                                UMABluetoothDiscoverySessionOutcome::SUCCESS);
      return;
    }
    internal_discovery_state_ = DiscoveryState::kStopping;
    discovery_request_pending_ = true;
    StopScan(base::BindOnce(&BluetoothAdapter::OnDiscoveryChangeComplete,
                            GetWeakPtr()));

    return;
  }

  // Inform BluetoothDiscoverySession that any updates they have made are being
  // processed.
  for (auto* session : discovery_sessions_)
    session->PendingSessionsStarting();

  auto result_callback = base::BindOnce(
      &BluetoothAdapter::OnDiscoveryChangeComplete, GetWeakPtr());
  auto new_desired_filter = GetMergedDiscoveryFilter();
  discovery_request_pending_ = true;
  filter_being_set_.CopyFrom(*new_desired_filter.get());
  if (internal_discovery_state_ == DiscoveryState::kDiscovering) {
    MaybeUpdateFilter(std::move(new_desired_filter),
                      std::move(result_callback));
    return;
  }
  internal_discovery_state_ = DiscoveryState::kStarting;
  StartScanWithFilter(std::move(new_desired_filter),
                      std::move(result_callback));
}

void BluetoothAdapter::NotifyDiscoveryError(CallbackQueue callback_queue) {
  while (!callback_queue.empty()) {
    std::unique_ptr<StartOrStopDiscoveryCallback> callbacks =
        std::move(callback_queue.front());
    callback_queue.pop();
    if (callbacks->start_error_callback)
      std::move(callbacks->start_error_callback).Run();
    // We never return error when stopping. If the physical adapter is messing
    // up and not stopping we are still just going to continue like it did stop.
    if (callbacks->stop_callback)
      std::move(callbacks->stop_callback).Run();
  }
}

void BluetoothAdapter::MarkDiscoverySessionsAsInactive() {
  // All sessions are becoming inactive so any pending requests should now fail
  if (!discovery_callback_queue_.empty())
    NotifyDiscoveryError(std::move(discovery_callback_queue_));
  // As sessions are marked as inactive they will notify the adapter that they
  // have become inactive, upon which the adapter will remove them from
  // |discovery_sessions_|. To avoid invalidating the iterator, make a copy
  // here.
  std::set<BluetoothDiscoverySession*> temp(discovery_sessions_);
  for (auto iter = temp.begin(); iter != temp.end(); ++iter) {
    (*iter)->MarkAsInactive();
    RemoveDiscoverySession(*iter, base::DoNothing(), base::DoNothing());
  }
}

void BluetoothAdapter::DeleteDeviceForTesting(const std::string& address) {
  devices_.erase(address);
}

void BluetoothAdapter::RemoveTimedOutDevices() {
  for (auto it = devices_.begin(); it != devices_.end();) {
    BluetoothDevice* device = it->second.get();
    if (device->IsPaired() || device->IsConnected() ||
        device->IsGattConnected()) {
      ++it;
      continue;
    }

    base::Time last_update_time = device->GetLastUpdateTime();

    bool device_expired =
        (base::Time::NowFromSystemTime() - last_update_time) > timeoutSec;
    DVLOG(3) << "device: " << device->GetAddress()
             << ", last_update: " << last_update_time
             << ", exp: " << device_expired;

    if (!device_expired) {
      ++it;
      continue;
    }

    DVLOG(1) << "Removing device: " << device->GetAddress();
    auto next = it;
    next++;
    std::unique_ptr<BluetoothDevice> removed_device = std::move(it->second);
    devices_.erase(it);
    it = next;

    for (auto& observer : observers_)
      observer.DeviceRemoved(this, removed_device.get());
  }
}

// static
const base::TimeDelta BluetoothAdapter::timeoutSec = base::Seconds(180);

}  // namespace device


text:
using System;
using System.Reflection;
using Mono.Addins;

using MonoDevelop.Ide.Gui;
using MonoDevelop.Ide;
using MonoDevelop.Ide.Gui.Pads;
using MonoDevelop.Components.Commands;
using MonoDevelop.Ide.Commands;
using MonoDevelop.Ide.Gui.Components;

namespace MonoDevelop.ValaBinding.ProjectPad
{
	public class ProjectPackageNodeBuilder : TypeNodeBuilder
	{
		public override Type NodeDataType {
			get { return typeof(ProjectPackage); }
		}

		public override Type CommandHandlerType {
			get { return typeof(PackageNodeCommandHandler); }
		}

		public override string GetNodeName (ITreeNavigator thisNode, object dataObject)
		{
			return ((ProjectPackage)dataObject).File;
		}

		public override string ContextMenuAddinPath {
			get { return "/MonoDevelop/ValaBinding/Views/ProjectBrowser/ContextMenu/PackageNode"; }
		}

        public override void BuildNode(ITreeBuilder treeBuilder, object dataObject, NodeInfo nodeInfo)
        {
            nodeInfo.Label = ((ProjectPackage)dataObject).Name;

            if (((ProjectPackage)dataObject).IsProject)
                nodeInfo.Icon = Context.GetIcon("md-vala-project-reference");
			else
                nodeInfo.Icon = Context.GetIcon(Stock.Reference);
        }
	}

	public class PackageNodeCommandHandler : NodeCommandHandler
	{
		public override void DeleteItem ()
		{
			ProjectPackage package = CurrentNode.DataItem as ProjectPackage;
			ValaProject project = CurrentNode.GetParentDataItem (
			    typeof(ValaProject), false) as ValaProject;

			project.Packages.Remove (package);

			IdeApp.ProjectOperations.Save (project);
		}

		public override DragOperation CanDragNode ()
		{
			return DragOperation.Copy;
		}

		[CommandHandler (MonoDevelop.ValaBinding.ValaProjectCommands.ShowPackageDetails)]
		public void ShowPackageDetails ()
		{
			ProjectPackage package = (ProjectPackage)CurrentNode.DataItem;

			// package.ParsePackage ();

			PackageDetails details = new PackageDetails (package);
			details.Show ();
		}
	}
}


text:
/*
 * Package Import
 */
import React from 'react';
import { Link } from 'react-router-dom';

/*
 * Local Import
 */

/*
 * Component
 */
const SiteMap = () => (

Plan du site

Vous êtes perdu? Pas de soucis, suivez le guide !

      <Link className="sitemap-link" to="/">
        Accueil
      </Link>
      <Link className="sitemap-link" to="/competences">
        Compétences
      </Link>
      <Link className="sitemap-link" to="/portfolio">
        Mes réalisations
      </Link>
      <Link className="sitemap-link sitemap-link-sub" to="/project/1/site-personnel">
        Site personnel
      </Link>
      <Link className="sitemap-link sitemap-link-sub" to="/project/2/o-quiz">
        O'Quiz
      </Link>
      <Link className="sitemap-link sitemap-link-sub" to="/project/3/love-app">
        Love App
      </Link>
      <Link className="sitemap-link" to="/contact">
        Contact
      </Link>
      <Link className="sitemap-link" to="/mentions-legales">
        Mentions légales
      </Link>
      <Link className="sitemap-link" to="/sitemap">
        Plan du site
      </Link>

);

/*
 * Export
 */
export default SiteMap;


text:
package com.planet_ink.coffee_mud.WebMacros;
import com.planet_ink.coffee_mud.core.interfaces.*;
import com.planet_ink.coffee_mud.core.*;
import com.planet_ink.coffee_mud.Abilities.interfaces.*;
import com.planet_ink.coffee_mud.Areas.interfaces.*;
import com.planet_ink.coffee_mud.Behaviors.interfaces.*;
import com.planet_ink.coffee_mud.CharClasses.interfaces.*;
import com.planet_ink.coffee_mud.Libraries.interfaces.*;
import com.planet_ink.coffee_mud.Common.interfaces.*;
import com.planet_ink.coffee_mud.Common.interfaces.Poll.PollResult;
import com.planet_ink.coffee_mud.Exits.interfaces.*;
import com.planet_ink.coffee_mud.Items.interfaces.*;
import com.planet_ink.coffee_mud.Locales.interfaces.*;
import com.planet_ink.coffee_mud.MOBS.interfaces.*;
import com.planet_ink.coffee_mud.Races.interfaces.*;
import java.util.*;

@SuppressWarnings("unchecked")
public class PollData extends StdWebMacro
{
    public String name()    {return this.getClass().getName().substring(this.getClass().getName().lastIndexOf('.')+1);}

    public String runMacro(ExternalHTTPRequests httpReq, String parm)
    {
        Hashtable parms=parseParms(parm);
        String last=httpReq.getRequestParameter("POLL");
        if((last==null)&&(!parms.containsKey("EDIT"))) return " @break@";

        String replaceCommand=httpReq.getRequestParameter("REPLACE");
        if((replaceCommand != null)
        && (replaceCommand.length()>0)
        && (replaceCommand.indexOf('=')>0))
        {
            int eq=replaceCommand.indexOf('=');
            String field=replaceCommand.substring(0,eq);
            String value=replaceCommand.substring(eq+1);
            httpReq.addRequestParameters(field, value);
            httpReq.addRequestParameters("REPLACE","");
        }

        if(parms.containsKey("EDIT"))
        {
            MOB M=CMLib.players().getLoadPlayer(Authenticate.getLogin(httpReq));
            if(M==null) return "[authentication error]";
            if(!CMSecurity.isAllowed(M,M.location(),"POLLS")) return "[authentication error]";
            String newTitle=httpReq.getRequestParameter("TITLE");
            if((newTitle==null)||(newTitle.length()==0))
                return "[missing data error]";

            if((last!=null)&&(last.length()==0)&&(CMLib.polls().getPoll(newTitle)!=null))
                return "[new title already exists!]";
            Poll P=CMLib.polls().getPoll(last);
            boolean create=false;
            if(P==null)
            {
                P=(Poll)CMClass.getCommon("DefaultPoll");
                create=true;
            }

            String old=httpReq.getRequestParameter("TITLE");
            if(old!=null) P.setName(old);
            old=httpReq.getRequestParameter("SUBJECT");
            if(old!=null) P.setSubject(old);
            old=httpReq.getRequestParameter("DESCRIPTION");
            if(old!=null) P.setDescription(old);
            old=httpReq.getRequestParameter("QUALZAPPER");
            if(old!=null) P.setQualZapper(old);
            long flag=0;
            old=httpReq.getRequestParameter("ISACTIVE");
            if((old!=null)&&(old.equalsIgnoreCase("on")))
                flag|=Poll.FLAG_ACTIVE;
            old=httpReq.getRequestParameter("ISPREVIEWRESULTS");
            if((old!=null)&&(old.equalsIgnoreCase("on")))
                flag|=Poll.FLAG_PREVIEWRESULTS;
            old=httpReq.getRequestParameter("ISABSTAIN");
            if((old!=null)&&(old.equalsIgnoreCase("on")))
                flag|=Poll.FLAG_ABSTAIN;
            old=httpReq.getRequestParameter("ISVOTEBYIP");
            if((old!=null)&&(old.equalsIgnoreCase("on")))
                flag|=Poll.FLAG_VOTEBYIP;
            old=httpReq.getRequestParameter("ISHIDERESULTS");
            if((old!=null)&&(old.equalsIgnoreCase("on")))
                flag|=Poll.FLAG_HIDERESULTS;
            old=httpReq.getRequestParameter("ISNOTATLOGIN");
            if((old!=null)&&(old.equalsIgnoreCase("on")))
                flag|=Poll.FLAG_NOTATLOGIN;
            P.setFlags(flag);
            old=httpReq.getRequestParameter("DOESEXPIRE");
            if((old==null)||(!old.equalsIgnoreCase("on")))
                P.setExpiration(0);
            else
            {
                String AP="AM";
                int hr=CMath.s_int(httpReq.getRequestParameter("HOUR"));
                if(hr>12){
                    hr-=12;
                    AP="PM";
                }
                P.setExpiration(CMLib.time().string2Date(
                   (CMath.s_int(httpReq.getRequestParameter("MONTH"))+1)
                   +"/"+httpReq.getRequestParameter("DAY")
                   +"/"+httpReq.getRequestParameter("YEAR")
                   +" "+hr
                   +":"+httpReq.getRequestParameter("MINUTE")
                   +" "+AP).getTimeInMillis());
            }
            P.getOptions().clear();
            int num=0;
            while(httpReq.isRequestParameter("OPTION"+(++num)))
            {
                old=httpReq.getRequestParameter("OPTION"+num);
                if((old!=null)&&(old.trim().length()>0))
                    P.getOptions().addElement(new Poll.PollOption(old));
            }
            if(create)
            {
                Log.sysOut(M.name()+" created poll "+P.getName());
                CMLib.polls().createPoll(P);
                return "Poll "+P.getName()+" created";
            }
            CMLib.polls().updatePoll(last, P);
            Log.sysOut(M.name()+" updated poll "+P.getName());
            return "Poll "+last+" updated";
        }
        else
        if(parms.containsKey("DELETE"))
        {
            MOB M=CMLib.players().getLoadPlayer(Authenticate.getLogin(httpReq));
            if(M==null) return "[authentication error]";
            if(!CMSecurity.isAllowed(M,M.location(),"POLLS")) return "[authentication error]";
            if(last==null) return " @break@";
            Poll P=CMLib.polls().getPoll(last);
            if(P==null)
                return "Unknown poll!";
            CMLib.polls().deletePoll(P);
            Log.sysOut(M.name()+" deleted poll "+last);
            return "Poll deleted.";
        }
        else
        {
            if(last==null) return " @break@";
            if(last.length()>0)
            {
                Poll P=null;
                String newPollID=httpReq.getRequestParameter("NEWPOLL");
                if(P==null)
                    P=(Poll)httpReq.getRequestObjects().get("POLL-"+last);
                if((P==null)
                &&(newPollID!=null)
                &&(newPollID.length()>0)
                &&(CMLib.polls().getPoll(newPollID)==null))
                {
                    P=(Poll)CMClass.getCommon("DefaultPoll");
                    P.setName(newPollID);
                    last=newPollID;
                    httpReq.addRequestParameters("POLL",newPollID);
                }
                if(P==null)
                {
                    P=CMLib.polls().getPoll(last);
                    if(P!=null)
                        CMLib.polls().loadPollIfNecessary(P);
                }
                if(parms.containsKey("ISNEWPOLL"))
                    return ""+(CMLib.polls().loadPollByName(last)==null);
                if(P!=null)
                {
                    StringBuffer str=new StringBuffer("");
                    boolean input=parms.containsKey("INPUT");
                    if(parms.containsKey("TITLE"))
                    {
                        String old=httpReq.getRequestParameter("TITLE");
                        if(old==null)
                            old=P.getName();
                        if(old!=null)
                            str.append(old+", ");
                    }
                    if(parms.containsKey("SUBJECT"))
                    {
                        String old=httpReq.getRequestParameter("SUBJECT");
                        if(old==null)
                            old=P.getSubject();
                        if(old!=null)
                            str.append(old+", ");
                    }
                    if(parms.containsKey("DESCRIPTION"))
                    {
                        String old=httpReq.getRequestParameter("DESCRIPTION");
                        if(old==null)
                            old=P.getDescription();
                        if(old!=null)
                            str.append(old+", ");
                    }
                    if(parms.containsKey("QUALZAPPER"))
                    {
                        String old=httpReq.getRequestParameter("QUALZAPPER");
                        if(old==null)
                            old=P.getQualZapper();
                        if(old!=null)
                            str.append(old+", ");
                    }
                    if(parms.containsKey("ISACTIVE"))
                    {
                        String old=httpReq.getRequestParameter("ISACTIVE");
                        if(old==null)
                            old=(CMath.bset(P.getFlags(),Poll.FLAG_ACTIVE)?"on":"");
                        if(old!=null)
                            str.append((old.equalsIgnoreCase("on")?"CHECKED":"")+", ");
                    }
                    if(parms.containsKey("ISPREVIEWRESULTS"))
                    {
                        String old=httpReq.getRequestParameter("ISPREVIEWRESULTS");
                        if(old==null)
                            old=(CMath.bset(P.getFlags(),Poll.FLAG_PREVIEWRESULTS)?"on":"");
                        if(old!=null)
                            str.append((old.equalsIgnoreCase("on")?"CHECKED":"")+", ");
                    }
                    if(parms.containsKey("ISABSTAIN"))
                    {
                        String old=httpReq.getRequestParameter("ISABSTAIN");
                        if(old==null)
                            old=(CMath.bset(P.getFlags(),Poll.FLAG_ABSTAIN)?"on":"");
                        if(old!=null)
                            str.append((old.equalsIgnoreCase("on")?"CHECKED":"")+", ");
                    }
                    if(parms.containsKey("ISVOTEBYIP"))
                    {
                        String old=httpReq.getRequestParameter("ISVOTEBYIP");
                        if(old==null)
                            old=(CMath.bset(P.getFlags(),Poll.FLAG_VOTEBYIP)?"on":"");
                        if(old!=null)
                            str.append((old.equalsIgnoreCase("on")?"CHECKED":"")+", ");
                    }
                    if(parms.containsKey("ISHIDERESULTS"))
                    {
                        String old=httpReq.getRequestParameter("ISHIDERESULTS");
                        if(old==null)
                            old=(CMath.bset(P.getFlags(),Poll.FLAG_HIDERESULTS)?"on":"");
                        if(old!=null)
                            str.append((old.equalsIgnoreCase("on")?"CHECKED":"")+", ");
                    }
                    if(parms.containsKey("ISNOTATLOGIN"))
                    {
                        String old=httpReq.getRequestParameter("ISNOTATLOGIN");
                        if(old==null)
                            old=(CMath.bset(P.getFlags(),Poll.FLAG_NOTATLOGIN)?"on":"");
                        if(old!=null)
                            str.append((old.equalsIgnoreCase("on")?"CHECKED":"")+", ");
                    }
                    if(parms.containsKey("DOESEXPIRE"))
                    {
                        String old=httpReq.getRequestParameter("DOESEXPIRE");
                        if(old==null)
                            old=(P.getExpiration()!=0)?"on":"";
                        str.append(""+old.equalsIgnoreCase("on"));
                    }
                    if(parms.containsKey("EXPIRATION")) // req input
                    {
                        Calendar exp=Calendar.getInstance();
                        if(httpReq.isRequestParameter("MONTH"))
                        {
                            String AP="AM";
                            int hr=CMath.s_int(httpReq.getRequestParameter("HOUR"));
                            if(hr>12){
                                hr-=12;
                                AP="PM";
                            }

                            String date=(CMath.s_int(httpReq.getRequestParameter("MONTH"))+1)
                                       +"/"+httpReq.getRequestParameter("DAY")
                                       +"/"+httpReq.getRequestParameter("YEAR")
                                       +" "+hr
                                       +":"+httpReq.getRequestParameter("MINUTE")
                                       +" "+AP;

                            exp=CMLib.time().string2Date(date);
                        }
                        else
                        {
                            long time=P.getExpiration();
                            if(time<1000) time=System.currentTimeMillis();
                            exp.setTimeInMillis(time);
                        }
                        if(!input)
                            str.append(CMLib.time().date2String(exp));
                        else
                        {
                            str.append("<SELECT NAME=MONTH>");
                            for(int m=0;m<12;m++)
                            {
                                str.append("<OPTION VALUE=\""+m+"\"");
                                if(m==exp.get(Calendar.MONTH))
                                    str.append(" SELECTED");
                                str.append(">"+CMLib.time().getMonthName(m+1,false));
                            }
                            str.append("</SELECT>");
                            str.append("/");
                            str.append("<SELECT NAME=DAY>");
                            int days = exp.getActualMaximum(Calendar.DAY_OF_MONTH); // 28
                            for(int d=1;d<=days;d++)
                            {
                                str.append("<OPTION VALUE=\""+d+"\"");
                                if(d==exp.get(Calendar.DAY_OF_MONTH))
                                    str.append(" SELECTED");
                                str.append(">"+d);
                            }
                            str.append("</SELECT>");
                            str.append("/");
                            str.append("<SELECT NAME=YEAR>");
                            int year=Calendar.getInstance().get(Calendar.YEAR);
                            if((exp.get(Calendar.YEAR)>1900)&&(exp.get(Calendar.YEAR)<year))
                                year=exp.get(Calendar.YEAR);
                            int doneYear=Calendar.getInstance().get(Calendar.YEAR)+10;
                            for(int y=year;y<=doneYear;y++)
                            {
                                str.append("<OPTION VALUE=\""+y+"\"");
                                if(y==exp.get(Calendar.YEAR))
                                    str.append(" SELECTED");
                                str.append(">"+y);
                            }
                            str.append("</SELECT>");
                            str.append("  ");
                            str.append("<SELECT NAME=HOUR>");
                            for(int h=1;h<=24;h++)
                            {
                                str.append("<OPTION VALUE=\""+h+"\"");
                                if(h==exp.get(Calendar.HOUR_OF_DAY))
                                    str.append(" SELECTED");
                                str.append(">"+h);
                            }
                            str.append("</SELECT>");
                            str.append(":");
                            str.append("<SELECT NAME=MINUTE>");
                            for(int m=0;m<=59;m++)
                            {
                                str.append("<OPTION VALUE=\""+m+"\"");
                                if(m==exp.get(Calendar.MINUTE))
                                    str.append(" SELECTED");
                                str.append(">"+CMLib.time().twoDigits(m));
                            }
                            str.append("</SELECT>");
                        }
                    }
                    if(parms.containsKey("NUMOPTIONS"))
                        str.append(""+P.getOptions().size()+", ");
                    if(parms.containsKey("NUMRESULTS"))
                        str.append(""+P.getResults().size()+", ");
                    if(parms.containsKey("OPTIONS"))
                    {
                        int which=-1;
                        if(parms.containsKey("NUM"))
                            which=CMath.s_int((String)parms.get("NUM"));
                        if(!httpReq.isRequestParameter("OPTION1"))
                        {
                            for(int v=0;v<P.getOptions().size();v++)
                            {
                                Poll.PollOption O=(Poll.PollOption)P.getOptions().elementAt(v);
                                httpReq.addRequestParameters("OPTION"+(v+1),O.text);
                            }
                        }
                        int num=0;
                        int showNum=0;
                        String sfont=httpReq.getRequestParameter("FONT");
                        String efont="";
                        if(sfont==null)
                            sfont="
";
                        else
                        {
                            String s=sfont.toUpperCase().trim();
                            if(s.indexOf("")>=0) efont+="";
                            if(s.indexOf("")>=0) efont+="";
                            if(s.indexOf("=0) efont+="";
                            if(s.indexOf("
=0) efont+="
";
                            if(s.indexOf("=0) efont+="	";
                            if(s.indexOf("
=0) efont+="
";
                        }

                        while(httpReq.isRequestParameter("OPTION"+(++num)))
                        {
                            String option=httpReq.getRequestParameter("OPTION"+num);
                            if((option.length()>0)
                            &&((which<0)||(which==showNum)))
                            {
                                ++showNum;
                                if(!input)
                                    str.append(sfont + option + efont);
                                else
                                    str.append(sfont + "<INPUT TYPE=TEXT NAME=OPTION"+(showNum)+" SIZE=60 MAXLENGTH=255 VALUE=\""+option+"\">" + efont);
                            }
                        }
                        if(input)
                        {
                            ++showNum;
                            str.append(sfont + "<INPUT TYPE=TEXT NAME=OPTION"+(showNum)+" SIZE=60 MAXLENGTH=255 VALUE=\"\">" + efont);
                        }
                    }
                    if(parms.containsKey("RESULTS"))
                    {
                        Vector options=P.getOptions();
                        Vector results=P.getResults();
                        int which=-1;
                        if(parms.containsKey("NUM"))
                            which=CMath.s_int((String)parms.get("NUM"));
                        int[] votes=new int[options.size()+(CMath.bset(P.getFlags(),Poll.FLAG_ABSTAIN)?1:0)];
                        PollResult R=null;
                        int choice=0;
                        int total=0;
                        for(int r=0;r<P.getResults().size();r++)
                        {
                            R=(PollResult)results.elementAt(r);
                            choice=CMath.s_int(R.answer);
                            if(((choice<=0)&&CMath.bset(P.getFlags(),Poll.FLAG_ABSTAIN))
                            ||((choice>=0)&&(choice<=options.size())))
                            {
                                total++;
                                if(choice<=0)
                                    votes[votes.length-1]++;
                                else
                                    votes[choice-1]++;
                            }
                        }
                        String sfont=httpReq.getRequestParameter("FONT");
                        String efont="";
                        if(sfont==null)
                            sfont="
";
                        else
                        {
                            String s=sfont.toUpperCase().trim();
                            if(s.indexOf("")>=0) efont+="";
                            if(s.indexOf("")>=0) efont+="";
                            if(s.indexOf("=0) efont+="";
                            if(s.indexOf("
=0) efont+="
";
                            if(s.indexOf("=0) efont+="	";
                            if(s.indexOf("
=0) efont+="
";
                        }
                        boolean pct=parms.containsKey("PCT")||parms.containsKey("PERCENT");
                        boolean showNum=(!pct)||parms.containsKey("VOTES")||parms.containsKey("VOTE")||parms.containsKey("COUNT");
                        for(int o=0;o<options.size();o++)
                        {
                            if((which<0)||(which==(o+1)))
                            {
                                str.append(sfont);
                                if(showNum)
                                    str.append(votes[o]);
                                if(pct)
                                {
                                    if(showNum)
                                        str.append(" (" + CMath.toPct(((double)votes[o])/((double)total))+")");
                                    else
                                        str.append(CMath.toPct(((double)votes[o])/((double)total)));
                                }
                                str.append(efont+", ");
                            }

                        }
                    }
                    if(parms.containsKey("MASKDESC"))
                    {
                        String mask=httpReq.getRequestParameter("MASK");
                        if((mask==null)&&(last.length()>0))
                            mask=CMLib.titles().getAutoTitleMask(last);
                        if(mask!=null)
                            str.append(CMLib.masking().maskDesc(mask)+", ");
                    }
                    String strstr=str.toString();
                    if(strstr.endsWith(", "))
                        strstr=strstr.substring(0,strstr.length()-2);
                    return clearWebMacros(strstr);
                }
            }
        }
        return " @break@";
    }
}


text:
package org.thingsboard.server.transport.lwm2m.client;

import lombok.extern.slf4j.Slf4j;
import org.eclipse.leshan.client.resource.BaseInstanceEnabler;
import org.eclipse.leshan.client.servers.ServerIdentity;
import org.eclipse.leshan.core.Destroyable;
import org.eclipse.leshan.core.model.ObjectModel;
import org.eclipse.leshan.core.model.ResourceModel;
import org.eclipse.leshan.core.node.LwM2mResource;
import org.eclipse.leshan.core.response.ExecuteResponse;
import org.eclipse.leshan.core.response.ReadResponse;
import org.eclipse.leshan.core.response.WriteResponse;

import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Calendar;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.PrimitiveIterator;
import java.util.Random;
import java.util.TimeZone;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;

@Slf4j
public class SimpleLwM2MDevice extends BaseInstanceEnabler implements Destroyable {

    private static final Random RANDOM = new Random();
    private static final int min = 5;
    private static final int max = 50;
    private static final  PrimitiveIterator.OfInt randomIterator = new Random().ints(min,max + 1).iterator();
    private static final List<Integer> supportedResources = Arrays.asList(0, 1, 2, 3, 9, 10, 11, 13, 14, 15, 16, 17, 18, 19, 20, 21);

    public SimpleLwM2MDevice() {
    }

    public SimpleLwM2MDevice(ScheduledExecutorService executorService) {
        try {
            executorService.scheduleWithFixedDelay(() -> {
                        fireResourceChange(9);
                    }
                    , 1800000, 1800000, TimeUnit.MILLISECONDS); // 30 MIN
        } catch (Throwable e) {
            log.error("[{}]Throwable", e.toString());
            e.printStackTrace();
        }
    }

    @Override
    public ReadResponse read(ServerIdentity identity, int resourceId) {
        if (!identity.isSystem())
            log.info("Read on Device resource /{}/{}/{}", getModel().id, getId(), resourceId);
        switch (resourceId) {
            case 0:
                return ReadResponse.success(resourceId, getManufacturer());
            case 1:
                return ReadResponse.success(resourceId, getModelNumber());
            case 2:
                return ReadResponse.success(resourceId, getSerialNumber());
            case 3:
                return ReadResponse.success(resourceId, getFirmwareVersion());
            case 9:
                return ReadResponse.success(resourceId, getBatteryLevel());
            case 10:
                return ReadResponse.success(resourceId, getMemoryFree());
            case 11:
                Map<Integer, Long> errorCodes = new HashMap<>();
                errorCodes.put(0, getErrorCode());
                return ReadResponse.success(resourceId, errorCodes, ResourceModel.Type.INTEGER);
            case 14:
                return ReadResponse.success(resourceId, getUtcOffset());
            case 15:
                return ReadResponse.success(resourceId, getTimezone());
            case 16:
                return ReadResponse.success(resourceId, getSupportedBinding());
            case 17:
                return ReadResponse.success(resourceId, getDeviceType());
            case 18:
                return ReadResponse.success(resourceId, getHardwareVersion());
            case 19:
                return ReadResponse.success(resourceId, getSoftwareVersion());
            case 20:
                return ReadResponse.success(resourceId, getBatteryStatus());
            case 21:
                return ReadResponse.success(resourceId, getMemoryTotal());
            default:
                return super.read(identity, resourceId);
        }
    }

    @Override
    public ExecuteResponse execute(ServerIdentity identity, int resourceId, String params) {
        String withParams = null;
        if (params != null && params.length() != 0) {
            withParams = " with params " + params;
        }
        log.info("Execute on Device resource /{}/{}/{} {}", getModel().id, getId(), resourceId, withParams != null ? withParams : "");
        return ExecuteResponse.success();
    }

    @Override
    public WriteResponse write(ServerIdentity identity, boolean replace, int resourceId, LwM2mResource value) {
        log.info("Write on Device resource /{}/{}/{}", getModel().id, getId(), resourceId);

        switch (resourceId) {
            case 13:
                return WriteResponse.notFound();
            case 14:
                setUtcOffset((String) value.getValue());
                fireResourceChange(resourceId);
                return WriteResponse.success();
            case 15:
                setTimezone((String) value.getValue());
                fireResourceChange(resourceId);
                return WriteResponse.success();
            default:
                return super.write(identity, replace, resourceId, value);
        }
    }

    private String getManufacturer() {
        return "Thingsboard Demo Lwm2mDevice";
    }

    private String getModelNumber() {
        return "Model 500";
    }

    private String getSerialNumber() {
        return "Thingsboard-500-000-0001";
    }

    private String getFirmwareVersion() {
        return "1.0.2";
    }

    private long getErrorCode() {
        return 0;
    }

    private int getBatteryLevel() {
        return randomIterator.nextInt();
//        return 42;
    }

    private long getMemoryFree() {
        return Runtime.getRuntime().freeMemory() / 1024;
    }

    private String utcOffset = new SimpleDateFormat("X").format(Calendar.getInstance().getTime());

    private String getUtcOffset() {
        return utcOffset;
    }

    private void setUtcOffset(String t) {
        utcOffset = t;
    }

    private String timeZone = TimeZone.getDefault().getID();

    private String getTimezone() {
        return timeZone;
    }

    private void setTimezone(String t) {
        timeZone = t;
    }

    private String getSupportedBinding() {
        return "U";
    }

    private String getDeviceType() {
        return "Demo";
    }

    private String getHardwareVersion() {
        return "1.0.1";
    }

    private String getSoftwareVersion() {
        return "1.0.2";
    }

    private int getBatteryStatus() {
        return RANDOM.nextInt(7);
    }

    private long getMemoryTotal() {
        return Runtime.getRuntime().totalMemory() / 1024;
    }

    @Override
    public List<Integer> getAvailableResourceIds(ObjectModel model) {
        return supportedResources;
    }

    @Override
    public void destroy() {
    }
}


text:
package org.apache.iceberg.orc;

import java.io.IOException;
import org.apache.hadoop.hive.ql.io.sarg.ConvertAstToSearchArg;
import org.apache.hadoop.hive.ql.plan.TableScanDesc;
import org.apache.hadoop.hive.serde2.ColumnProjectionUtils;
import org.apache.hadoop.mapred.JobConf;
import org.apache.hive.iceberg.org.apache.orc.Reader;
import org.apache.hive.iceberg.org.apache.orc.TypeDescription;
import org.apache.iceberg.FileScanTask;
import org.apache.iceberg.Schema;
import org.apache.iceberg.expressions.Binder;
import org.apache.iceberg.expressions.Expression;
import org.apache.iceberg.io.InputFile;
import org.apache.iceberg.mapping.MappingUtil;

/**
 * Utilities that rely on Iceberg code from org.apache.iceberg.orc package.
 */
public class VectorizedReadUtils {

  private VectorizedReadUtils() {

  }

  /**
   * Adjusts the jobConf so that column reorders and renames that might have happened since this ORC file was written
   * are properly mapped to the schema of the original file.
   * @param inputFile - the original ORC file - this needs to be accessed to retrieve the original schema for mapping
   * @param task - Iceberg task - required for
   * @param job - JobConf instance to adjust
   * @throws IOException - errors relating to accessing the ORC file
   */
  public static void handleIcebergProjection(InputFile inputFile, FileScanTask task, JobConf job)
      throws IOException {
    Reader orcFileReader = ORC.newFileReader(inputFile, job);

    try {
      // We need to map with the current (i.e. current Hive table columns) full schema (without projections),
      // as OrcInputFormat will take care of the projections by the use of an include boolean array
      Schema currentSchema = task.spec().schema();
      TypeDescription fileSchema = orcFileReader.getSchema();

      TypeDescription readOrcSchema;
      if (ORCSchemaUtil.hasIds(fileSchema)) {
        readOrcSchema = ORCSchemaUtil.buildOrcProjection(currentSchema, fileSchema);
      } else {
        TypeDescription typeWithIds =
            ORCSchemaUtil.applyNameMapping(fileSchema, MappingUtil.create(currentSchema));
        readOrcSchema = ORCSchemaUtil.buildOrcProjection(currentSchema, typeWithIds);
      }

      job.set(ColumnProjectionUtils.ICEBERG_ORC_SCHEMA_STRING, readOrcSchema.toString());

      // Predicate pushdowns needs to be adjusted too in case of column renames, we let Iceberg generate this into job
      if (task.residual() != null) {
        Expression boundFilter = Binder.bind(currentSchema.asStruct(), task.residual(), false);

        // Note the use of the unshaded version of this class here (required for SARG deseralization later)
        org.apache.hadoop.hive.ql.io.sarg.SearchArgument sarg =
            ExpressionToOrcSearchArgument.convert(boundFilter, readOrcSchema);
        if (sarg != null) {
          job.unset(TableScanDesc.FILTER_EXPR_CONF_STR);
          job.unset(ConvertAstToSearchArg.SARG_PUSHDOWN);

          job.set(ConvertAstToSearchArg.SARG_PUSHDOWN, ConvertAstToSearchArg.sargToKryo(sarg));
        }
      }
    } finally {
      orcFileReader.close();
    }
  }
}